Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-11-14 21:10:38
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Rotating images in the header
Is there a plugin that allows you randomly rotate images in the banner section?
Or moreover, I actually need certain images to show up for certain sections that the client is on. How would I go about achieving this when creating my Header Form for this?
Offline
Re: Rotating images in the header
use a combination of if_section and any of the various random image plugins?
Offline
#3 2007-11-14 23:14:03
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Rotating images in the header
Or give the images the name of the section (don’t upload them through the images tab) and use
<img src="<txp:site_url />images/<txp:section />.jpg" />
Offline
Re: Rotating images in the header
dreamer wrote:
Is there a plugin that allows you randomly rotate images in the banner section?
How did I miss this post? smd_random_banner should do what you want, as iblastoff alluded in a far timelier fashion than I have.
You don’t need to be particularly devious either. Just put your images in various categories labelled the same as the sections you want them to appear in and use random_banner’s category="?s"
attribute. Job’s a good’un.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#5 2008-11-16 04:34:11
- boomer
- Member
- Registered: 2006-11-19
- Posts: 19
Re: Rotating images in the header
@bloke:
I just tried your plugin, but somehow I have a problem: is it possible to use it when my header image is defined using CSS? My header image just vanishes all the time… (even when I use the example from the readme…)
Basically I have a category “header” with a set of different header images that i would like to rotate randomly…
Last edited by boomer (2008-11-16 04:35:05)
Offline
Re: Rotating images in the header
boomer wrote:
Basically I have a category “header” with a set of different header images that i would like to rotate randomly…
Hmm, it should work ok with category="header" raw_url="1"
set, just like in Example 3. Remember the style you define must be inside <style type="text/css">... </style>
tags on your page template or in a form; it won’t work inside a stylesheet (one in the Styles tab) since they are not parsed for tags. Unless you use smd_style to manage your sheets and use parse_tags="1"
of course :-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#7 2008-11-17 07:07:05
- boomer
- Member
- Registered: 2006-11-19
- Posts: 19
Re: Rotating images in the header
Thank you for your quick help!
I inserted it in a form, and I think i did it right. But now a different problem strangely occured… whenever I implement the _smd_random_banner_-tag somewhere (even in an plain article), I get this when I reload my website:
Fatal error: Class ‘smd_MLP’ not found in /var/www/user/html/mydomain/textpattern/lib/txplib_misc.php(574) : eval()’d code on line 11
To be honest, I don’t know 100% if it ever worked… but googling doesn’t bring any useful clues (not even hits…), so I’m kind of confused…
Am I missing a dependence, or something?
Offline
Re: Rotating images in the header
boomer wrote:
Am I missing a dependence, or something?
Yes, you need smd_lib. That should sort you out :-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#9 2008-11-17 17:03:16
- boomer
- Member
- Registered: 2006-11-19
- Posts: 19
Re: Rotating images in the header
Ahh, ok, installing the smd_lib solved the problem. And I discovered why my header stayed blank: I just copied&pasted the piece of code from example 3 of your readme, and there is a unnecessary semicolon in the first line (don’t know, might be necessary to prevent this code from being executed?):
<style type=“text/css”>;
But i concentrated so much on the smd_random_banner tag that i just overlooked it all the time. After removing it everything was fine!
Thank you so much for you help, Bloke! I don’t think I would have been able to solve this thing without you!
Offline
Re: Rotating images in the header
boomer wrote:
there is a unnecessary semicolon in the first line
Ooops, thanks for spotting that. I’ll remove it. Glad you got the background header working.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Pages: 1