English 中文(简体)
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)




相关问题
vectors vs. vector graphics

What (if any) is the relationship between vectors used in programming languages (e.g. arrays) and vector graphics? Why do they share the term vector? Does it represent some analogous aspect of their ...

MVC and Property Terminology in Objective-C

I am having a problem with terminology I think. Is a ViewController the Controller portion of MVC? Or is it not the same thing. Is this combining the VC of MVC into one file? Properties like ....

Origin of "map" in Computer Science

In computer science, there are two definitions of the word map. The first is as an associative array, a type of container that maps values of one type to values of another type. An example of this is ...

Definition of the word "patch"

Personally, I use the word "patch" as the software equivalent of a symptomatic treatment, which makes a patch a quick-and-dirty bugfix. However, I m not sure this is correct, because I often see it is ...

What is Facet in JavaEE?

I wonder not only what is Facet but also what is Facet in physical level (as I understand it s not a separate jar, but what?)? I also wonder how can it affect my application after deploying. I ll ...

What is the meaning of "POSIX"?

What is POSIX? I have read the Wikipedia article and I read it every time I encounter the term. The fact is that I never really understood what it is. Can anyone please explain it to me by explaining ...

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 ...

热门标签