开发者

Term for rotating header

I'm looking for terminology that describes this behavior:

The header of a web-page contains a different image every time you visit it.

Update: It is not an advertisement, but 开发者_运维技巧images related to the subject of the site.

E.g. An imaginary site for a bakery would show, next to the logo, randomly

  • a picture of the front of the shop
  • a macro shot of some patisserie
  • ...

More specifically: I'm building a Drupal site and was looking for a theme or module that could help me do that, but don't know the term to search for. 'Rotate', 'Image', 'Header' are rather ambiguous.

Related question: How to implement seasonal logos in Drupal?

But without the time constraints: I'm looking for 'just a random header for every visit'

Thanks!

Jan


Also, you could just make a View that displays only nodes of a certain content types where you've stored your header images, then limit the number of nodes the view displays to one and under the sorting section add a random sort. That should bring up a new image on each page refresh.

By far the easiest solution.

EDIT: By the way, the Drupal equivalent of an "AdRotator" thing is a Rotor


Given that this is usually an advert, it's usually called an AdRotator, like this one for ASP.NET.


This was a simple but effective solution, using cck and views:

Create a 'header pics' content type. Add fields for images, url, and 'show when' select list.

Images I used image upload with cropping module, constrained to 400px wide by 100px high to fit in header block.

'show when' select list I populated with summer, winter, fall, Halloween, Christmas, Veteran's Day, etc.

url is optional.

In view, filter by type = header_pic and show_when = whatever you want displayed now

Need the Customfield PHP module addon for views, and add:

<?php
$temp = node_load($data->nid);
if ($data->node_data_field_header_pic_url_field_header_pic_url_url) { 
    echo '<a href="' . $data->node_data_field_header_pic_url_field_header_pic_url_url 
. '" title="' . $data->node_data_field_header_pic_url_field_header_pic_url_title 
.'"><img src="/' . $temp->field_header_image[0]['filepath'] . '" /></a>';
} 
else { 
    echo '<img src="/' . $temp->field_header_image[0]['filepath'] . '" />';
}
?>

Where the fields I've noted correlate to your actual fields.

What this does is wrap the image with that url field only if the url field is populated.

Then set the view in a block display, and set that block in the header region. Depending on theme, you may need to hack the page.tpl.php a little to move that header block region into the real header area (but once you get in there it's easy to see what you need to do).

You can even make a page view of this same view to display all of your great header images at once on a page (/headerpics), with an edit link by each for easy manageability.

This will work if you just want seasonal images.


I wasn't looking for any ad-style solutions.

This site 'regularly' changes the picture at the top, and that doesn't annoy me.
I'm just assuming something along this solution for WordPress is used.

They use the term 'dynamic headers'.

And this was what I was looking for:

dh_get_random_media_item() - 
Will return the URL of a random media item contained in the Dynamic Headers media directory

Off to find something similar for Drupal.


I'm not aware of a module for this.

In case you need to do a custom implementation, be aware of caching problems - if you implement your rotation logic in the backend only, it will only work for non cached page views. If it needs to work for cached pages also, you'd need a javascript solution (either pulling the image separately, or, in case of a small set of images, setting different parts of a sprite).


Edit: Moved the following down, as the OP is not looking for ad-style solutions.

Some more terms from the realm of advertising:

  • 'superbanner' (or 'Super Banner') for the horizontal ads at the top
  • 'skyscraper' for the large vertical ads (usually on the right)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜