1

I am new to Drupal and struggling on the best approach to choose, I have several questions which are all related to my approach.

Let say I have a content type "Rooms" and would like to create 2 pages: 1 for listing the rooms and one per room (let's call that one Room A), plus I would like to add some additionnal data for the page listing rooms. Of course I need menu item when being on page "Rooms" but still need the item to be active when on page Room A.

Finally, the page Rooms not only list the room's content type but also display some static blocks which both has and has no relationship to the Room content type.Eg: an image's banner with a small description.

After doing some research, I have found several approach to do this:

  1. Have a taxonomy "Rooms" with no terms and in which I classify all my rooms and add additional field for data specific such as my banner picture. I then create a basic page which I theme to call my blocks and taxonomies. The menu active trail issue is realized by taxonomy-menu trail.

Pro: it works. Cons: the logic bothers me, the purpose of taxonomy is more like a tagging system rather. Therefore I have to tag my content's instance each per each

  1. I create a new content type "Banner" in which I add new fields, an image, a description... Using Node Hierarchy menu, I create a parent relationship for a basic page to a room content type, on that basic page i display all my block...

So, OK the content type is not a page it's an abstract of fields, but what if I want to display in the most efficient way data that are on higher level of abstraction of the content type and that are specific to that content type ?

What's your opinion ?

0

If I have understood well, here is what I would do:

  • Create a content type "Room", with specific fields and configuration (I guess you already did that).
  • Create several nodes of type "Room", one by actual room.
  • Create a View (using Views module) to display a list of all my nodes of type "Room" (I can tell you more about that if you need it) and where you can access the rooms page automatically. Of course, you can create a menu item in the same time. Very easy.
  • Create a custom static block with the banner, text, or whatever you want to be displayed on your View page.
  • Configure the block to be displayed only on your View page (path/to/your/view).

This is how I would have do that if I had to. I don't know if there is a better way but it seems quite logic and simple to me.

I hope it was the answer you wanted!

EDIT: I just remember the active menu item thing. I did that once in a project, it is a bit tricky but I can explain to you my method.

  • Hi, I have multiples pages which observe the same layout with one main jumbotron specific to the page. In my Room example, a banner, description of the page, display of a "from price", in another page "Activities" I'll have another jumbotron specific to the content type it hosts, an image, a description etc.. Therefore I don't feel like creating one static block for each page while it will be using the exact same layout, but creating another content type for giving an abstraction layer to a content type does not sound like a natural approach. I'm also using views but thanks for the advice ! :) – Gauthier L. Jul 10 '14 at 10:43
  • I think you have no choice to create 1 block per content-type you have. Assign these blocks to a region (custom or not). Test in module or template the path of your page and display a specific block depending on the path. Or I'm misunderstanding – Djouuuuh Jul 10 '14 at 11:54
  • Hi, following your comments I've thought about a new question (drupal.stackexchange.com/questions/123330/…), a bit a mix of what you said and what I desire, OK for creating a block per page but what if that block is a content type ? Then it becomes easier and better for user xp to create an instance of a block and display that instance based on some filter on the defined pages – Gauthier L. Jul 12 '14 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.