Closed (won't fix)
Project:
Marinelli
Version:
5.x-1.0
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2008 at 20:39 UTC
Updated:
14 Dec 2010 at 14:39 UTC
I love the theme and really appreciate all the work you have done. I am looking for a way to have the banner rotate based on the node I am viewing. For example, If I am on node 2, I could have a banner named banner2.jpg. Is there a way to right it into the code. I am already using the rotating image code from http://ma.tt/scripts/randomimage/ . Can I tell it which banner to place on which page?
Comments
Comment #1
dchapiesky commentedI fixed this in 6.x - you may be able to back port it....
check #241962: Banner assignment rather than banner rotation.... for the modification I did...
Specifically, I rewrote rotate.php to accept ?title=
The original style sheet had
I moved this to page.tpl.php as an inline style sheet:
and wrote marinelli_banner() in template.php
The title is retrieved, made lowercase, and stripped of all whitespace. The url is constructed and returned as part of the style sheet for the page...
I have no idea about mods for 5.x but this should give you a good chance at it...
check #234410: Random Header Not So Random For Me for caching issues related to banner image update...
Daniel
Comment #2
garg_art commentedAwesome!
Comment #3
dchapiesky commentedAny suggestions for it?
Comment #4
garg_art commentedI have not tested it yet and to see the full effect. But I think your thoughts are exactly taking this theme to the next level. random rotation is good. But contextual rotation is more meaningful for visitors as well as web site owner. It has tremendous extensibility. Like the Grandparents starts with black&white picture of them and Children starts with boisterous picture of boys/girls gone crazy in a slumber party.
That is powerful.
Comment #5
dchapiesky commentedThanks...
the one bug I have found is this:
1) www.mysite.com - displays my welcome page - but gets a random banner
2) www.mysite.com/node/1234 - displays my welcome page - and gets the proper banner...
I need to check what the title of the page is when it is the default (drupal_get_title()) so that I can create a properly named banner file.
On a different note....
In template.php, I use drupal_get_title() to determine the page title. There is no reason the selection process couldn't be more personal or fine grained.... base it on user name? base it on how revered they are in the community with expert points, base it on pretty much anything....
Daniel
Comment #6
Lioz commented