Frage

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?

War es hilfreich?

Lösung 4

I resorted to using the EVA module ( http://drupal.org/project/eva ).

Andere Tipps

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.

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top