I'm a novice at drupal, so I'm still figuring things out. I'm looking for a way to accomplish the following the 'drupal way'.

I want to create a component, or a block, or something that allows the end user to enter a url to a page, a description, a title and an image. This component would be visible on the page as a clickable item.

I've tried using a custom content type, and used the views module to create a block out of these. This works, but it displays the same items as a block on each page. I need a way to make them different on each page. I'm not sure blocks is the way to go.

  • When you say 'different on each page', what are your criteria for filtering? Are you looking for a random different node per page, or are you looking to get some contextual information from each page to filter by? If the latter, what specifically do you want to use for the filter (field, node property, etc)
    – Clive
    Apr 21 '14 at 15:31
  • I'm not looking for contextual information of each page to filter by. Currently, all information is contained in the custom type (a title, a description, an image and a link to an existing page). I currently have 4 of these items, which i used to create a view which i turned into blocks on a product page. My issue is, I need a way to have to admin choose which of these items should be visible on each specific product page without him needing a technical background to manage this. The admin should be able to select item 1 and 2 for product page A, and item 1 and 3 for product page B.
    – 3xil3
    Apr 21 '14 at 15:39

So, you need admin to be able to add one or two piece of content to a specific page.

Let's say you have content type Product content type. For the custom content you can create a new content type, let's say Banner. Consists of these fields:

  • Title
  • Description
  • Image
  • Link
  • Reference to Product

Then you can simply create a Views which lists all Banners which have a reference to the current Product in the page. (Using contextual filters and the referenced field)

All Admin needs to do is to creates a Banner and indicate the Product to be displayed in.

You can also check Prepoulate module, for letting admin create the Banner straight from the Product edit page.

  • This is quite elegant. And thanks for proposing the prepopulate module, I've had never heard of it.
    – 3xil3
    Apr 21 '14 at 18:17

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.