Different pages for showing different fields of a single node in Drupal 7 - drupal

Is it possible to elegantly do this? The idea is, a node of content type "project" has a lot of fields, its url is something like node/5. I want to show some of the fields on that page, and others on node/5/extra, kind of an "extended" page that the user only loads if he is interested in that content (lots of images, in my case, that would slow down the main node page considerably).
I tried the Display suite module, unsuccessfully (it seems it's not really meant for doing what I want). I also saw this blog post, which explains how to add a custom display mode to a content type (other than the Default and Teaser ones that come by default), but I can't get it to work the way I want to either.

I guess you could create a view having the node ID as a default argument from URL. Then you can choose which fields to show or hide

Related

Taxonomy block view shows no content

I am using Drupal 8.
I am trying to create a block display to show a list of teasers with the taxonomy term of the current node, within a custom region.
The problem is that when I navigate to the page which contains the custom region no content is displayed.
Other blocks display fine when assigned to the custom region so I don't think its anything to do with my templates.
The same view also has a page display (basically the default taxonomy term view) which shows content correctly when i navigate to the node.
I am a relative Drupal newbie so may be missing something obvious here but as far as i can tell the taxonomy view works as a page but not as a region, so either it must be something to do with the block configuration, or Drupal is just not meant to work like this.
Can anybody suggest what might be causing this, or if this is a bad approach explain why?
are u using exposed filters in your view ?
For it to work in blocs , u need to configure in your view
ajax:on

Drupal 7: Add view to content type

I've been making a template for a particular content type, but just ran into a problem: I need to embed a view into the content type.
I am aware this can be done via several different methods, but I don't see one that fits exactly my needs:
I need the view added automatically for all pages of that content type.
Using blocks in a region is not an option, as I want to avoid defining a region in the middle of a page that should only be available for a specific content type.
Translatable label.
Possibility to freely apply a template to all fields in the content type (excluding the embedded view).
I tried doing it via page layout (Panels) and simply adding node content fields and the view to my layout regions, but then I get another problem: I can't style my content fields without doing something that seems a bit over the top:
Currently I have about 20 different content fields in the content type that are wrapped in HTML and styled in my template file. I have a translated label for each of these in the template file. From what I can tell I'd have to add a template for each of the panes containing content fields to add my translated labels and HTML needed to style each field.
I'm not really fond of making 20 templates, 20 theme hook suggestions to get the templates to work and 20 regions in the panel layout just to get a view inserted in the content type.
Am I doing something terribly wrong here? Any suggestions?
You may want to try the Viewfield module or similar modules (search for "view field" or "view reference").
If you are doing something more complex like changing/filtering the view based on some value in your content type, then you may have to use Viewfield module in combination with something else that will help fill in the filter values.
I've never done something like this before so I'm not sure exactly what module combination would work but Rules or Computed Field come to mind as possible helpers.
You have to use "views node field" http://drupal.org/project/viewsnodefield, after installing this module you have to select the "Node content" in the display (like blocks,page). then click the add display. if you want to display the content like this page http://www.richtown.ae/?q=content/arabian-ranches then you have to download the views_galleriffic module and install it and choose the style option "Galleriffic Gallery". You can choose the content type by using the filter in the views.
That's it cheers
i implemented this in my website richtown.ae
if you still unclear please send me the email social#richtown.ae i will reply you & ready to help you we can share information
i am using this module in drupal 6.
I resorted to using the EVA module ( http://drupal.org/project/eva ).
In addition to Woodgnome's answer
Let's say you have a content type named 'Product'
You want to attach a view to it.
Here are the steps using the eva module :
On your view edit page :
Section Displays
+Add : Eva field
Section ENTITY CONTENT SETTINGS
Entity type:Node
Bundles:Product
That's it, going to a node product type will now display the view

Fb like share box in drupal website

I am making a drupal website and have a content type "quotation". The standard way of taking input in drupal is going to the create content in the menu which is not very user friendly considering your normal user.
I want to have an option to create content (i.e quotation) like in facebook, twitter or any other social networking site. A share box where someone can type in his status and can directly create content.
Also, I have two vocabularies associated with my content type and I want to accommodate them as well while using minimum space. So, how should I go about the problem.
Is there any module in Drupal which can help me in doing so or I have to write Jquery code myself.
two vocabularies associated with my
content type and I want to accommodate
them as well while using minimum
space.
Lol, sounds tough. If you want to use minimal space you'll need to simplify the workflow, ie, remove a vocabulary or 2.
You can also do something like this:
$('#node-edit').focus(function (){
// set your node form vocab to display:none and then show them when user actually uses the form
$('.vocab-wrappers').show();
// set your node form buttons to display:none and then show them when user actually uses the form
$('#node-form buttons').show();
});
To hide the vocabularies/buttons until the user is editing the content.
To get a facebook like effect, I suggest you use: http://drupal.org/project/formblock
This should get you the form and the ability to place it anywhere.
You can use form alter to hide certain parts of the form, or a form alter module, there's various options if you look in drupal modules.
http://drupal.org/project/nodeformcols
You also want http://drupal.org/project/auto_nodetitle to make the title optional, and hidden from the form.
Lastly, theme the node form in CSS/JS, making the texarea smaller and whatever other stuff you would like, recommend setting display:none on the field labels.
This should give you the correct idea for making a decent facebook-like form setup.
This should be possible:
http://drupal.org/node/464906
I've never tried it myself though.

Drupal: Content in blocks from node_reference fields?

After only a few weeks of working with Drupal I've come up with a recurring problem, which I don't really have an optimal solution to, so I'm hoping that someone here might be able to give some best practice pointers.
What I have is a region inside my node.tpl.php, which is populated with blocks that display content from two different CCK fields of the type node_reference. This works fine when displaying a single node. The problem appears when I need to use a view.
For example, lets say I have a news listing, and a single news item view. When I display the single news item I can use the news node node_reference field to reference whatever material I would like to have in my sidebar, but when on the news listing view I would like to reference nodes separately. What would be the best practice to solve this?
I'm having a few ideas, but none seem like the logical choice, how would you do?
My understanding of your problem is that you don't want the blocks to display on the view page and you want the block information displayed inline with the node.
The first part is easy, you can modify the block visibility settings to not show up on the path where you have the view.
The second part will depend on how you set up your view. If you are using fields you can simply add fields for the node_reference and they should display. If you are using a node view, you will have to override the template and create a template which displays the node reference field.
If you want further explanation please comment and I can clarify
After reading my question I realize that it was explained pretty badly, so I'll try again, and also tell how I solved it.
The Problem
On normal "pages" (when displaying only a single node), I have a sidebar that shows something similar to banners, which are either random, or I can select one or many that should always be displayed on the sidebar. This is solved easily when displaying a single node, using a CCK node_reference field. The problem is when using a View that displays multiple nodes, for example a news listing-
The Solution
In my case I could solve this by creating additional fields on my default Page content-type. These fields were called view, display and arguments. In my tpl.php I then embedded the news listing view inside a page, lets call it News. This way I gained great flexibility, and also helps the News page to know where it is located in menu structure.
Final comments
I have yet to discover if there are any drawbacks or dangers in doing this way, but if there are, feel free to share them with me :)
I tend to want to create my own modules, which create blocks and reference the database directly. Then I put the blocks inside of panels, this seems to be more flexible for me than using views and cck fields etc ...

Problem attaching Ubercart view to relevant content

Example page: http://giantcalculator.com/content/cartridge-filters
It’s very cumbersome to connect the ubercart view to a relevant content page. In the example above I have attached the view to the bottom; you can scroll down to see it. It is a tedius process though in which I have to create the view, then create a mini panel, include the view in the mini panel, then go to blocks page and add the mini panel to region (currently a region below the main content), then I have to configure the block so the view only appears on it’s one particular page.
This seems far too complicated and the particular region will soon have about 20 blocks inside it, though each only appearing on one page. Is there a better way to attach a view to its relevant content info, or vice versa?
I know the view creates a page of its own, and if I could add the content on top of the view that would be great. Or within the view itself, can the content be added somehow?
I'm almost ready to move forward with this site but I really need to find if there is a better method first. I'm posting this in a number of places and offering a $20 bounty via paypal to the first responder with best alternative that I end up using. (if there is one). Bounty may be shared if two or more people have the same response on different forums and I can't tell who was first, though when I do have an answer I'll promptly post it.
Other forums this will post include Drupal.org paid forum, Ubercart Bounty forum, aardvark, superuser and stackoverflow.
If I understand correctly, I think the piece of the puzzle you're missing is Views arguments. If you ever find yourself creating more than one view, where the only difference is the content (ie. based on taxonomy, or a certain CCK field), you probably want to use that as an argument in the view so it loads the correct content automatically.
I assume "cartridge filters" is a taxonomy term, and the page linked above is a node with this term applied. So you'd add a taxonomy arg to your view in the Views admin, and get it to pull the term from the current node. There are a bunch of tutorials out there on this, and here's a screencast: http://gotdrupal.com/videos/drupal-views-arguments
I'm also not sure why you're using mini panels. They're generally used for sets of blocks or other content to be displayed repeatedly, like a tabbed block or footer. It sounds like you just want a regular block display of the aforementioned view. You could also make this entire page a Panel.

Resources