Need php script that appends article alias as image name
Posted: Sat Mar 08, 2008 11:53 pm
Hi,
I have a site for which I'd like to load backgrounds based on the alias of the article loaded. I'm no good at php and understand the deeper parts of joomla! functionality even less (like how to do the appropriate info query), and after many failed attempts at it, I'm asking for help. Here's the design spec as I see it:
1. I have a wrapper div with css id "wrapper", where I set the background-image.
2. In the template index.php (or if there's a more logical place, please suggest!) there is a PHP script:
a. queries for alias of current article (or falls back to "default" for front page).
b. appends alias as part of image name in style -- ie: background-image: url("<path to image>/<alias>.png");
thus, for article with alias "joomla_rules" the background image "joomla_rules.png" is loaded into template.
Any takers?
I have a site for which I'd like to load backgrounds based on the alias of the article loaded. I'm no good at php and understand the deeper parts of joomla! functionality even less (like how to do the appropriate info query), and after many failed attempts at it, I'm asking for help. Here's the design spec as I see it:
1. I have a wrapper div with css id "wrapper", where I set the background-image.
2. In the template index.php (or if there's a more logical place, please suggest!) there is a PHP script:
a. queries for alias of current article (or falls back to "default" for front page).
b. appends alias as part of image name in style -- ie: background-image: url("<path to image>/<alias>.png");
thus, for article with alias "joomla_rules" the background image "joomla_rules.png" is loaded into template.
Any takers?