0

I'm looking for an easy way where my users can add banners on a page. There are many options here (View Slideshows, Rotating Banners,...) but what I want is a user to be able to do this as simple as possible.

The ideal scenario would be:
Create content - upload image - type a title and select the pages on which it should be displayed.

Basically, my (absolute n00b users) must be able to add a banner to any page available without any knowledge of views, panels,...

I've experimented with node references and templates, but no luck so far.

Is their anyone with the same situation and found out a great solution?

  • What version of Drupal are you using? What "pages" do you expect the user to be able to select? Will the banners be on the front page? on taxonomy pages? on specific sections of the site? on certain content types? on view pages? admin pages? – Alpha Codemonkey Feb 21 '12 at 15:14
  • I'm using Drupal 7. The content managers should be able to add a banner to any page available on the site (front page, side pages, view pages,...) but they should be always be in the upper part of the site. – Michiel Feb 21 '12 at 15:26
1

The simplest would be a content type with an image field and a text field. The image field would be the banner and the text field would be the path on your website where it should be displayed.

Create a view that filters on that content type and has the image as the field it displays. Put the path field as an argument. Configure it to return only 1 item.

In a block, call that view using $_GET['q'] as the argument.

Image is displayed in the block. Display this block on your page where you want your banner.

Don't like blocks? Put this in a page_preprocess() hook and assign the view output to a variable and put this in your page where ever you want it.

Get fancy? Randomize the sort so if more than one of these content types has the same path a different image is displayed on each page load/reload.

Get fancier. Use the views_nivo_slider module ( http://drupal.org/project/views_nivo_slider )

| improve this answer | |
  • Great suggestion! Although, I'm not sure I get what you mean with the arguments... The way it's configured now. One node of the 'banner'-content type has a path /nl, /en and /fr (because I'm working with a multilingual site). I've set the contextual filter on path, but whenever I enter the /nl, /fr or /en filter in the view preview, nothing shows up. What do I do wrong? – Michiel Feb 21 '12 at 15:59
  • Arguments are drupal6speak and I am not very up on drupal7 yet, but basically you want to filter on the full text of that field versus the full path. Perhaps someone more fluent in drupal7 can tell you exactly how to do it as I was thinking you would put foo/bar/bazz/bing in the field, not individual components and nl en and fr look like just the language components to me. – Jimajamma Feb 21 '12 at 16:12

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.