Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Topic closed
Different background image per article
Hello
I’m trying to figure out how to set <txp:article_image /> as a background image for a div .. on a per article basis .. I’d basically like to tile a specific image in the background for each article in a section.
If anyone could suggest whether this is possible .. and point me in the right direction .. I’d be very grateful.
Thank you,
Simon
Offline
Re: Different background image per article
Haven’t given this much thought, but perhaps put the URL of the article’s background image in a custom field, and then call to it using the <code><txp:custom_field /></code> tag?
Last edited by Elenita (2006-06-15 00:05:20)
Offline
#3 2006-06-14 23:33:37
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Different background image per article
Yep that’s one way of doing it, which I’ve used before, and it works quite well. :)
Offline
Re: Different background image per article
spiffin,
you could do the above through having style=“background:<txp:custom_field />”
or to achieve true seperation of content and style
set the div with an id or class using the article id/title and code the background within the css file itself.
Offline
Re: Different background image per article
Excellent .. thank you all for your help.
I made a custom field called ‘background’ and a form which wrapped the article in a div:
div style=“background: url(../images/<txp:custom_field name=“background” />) repeat;”
Simon
Last edited by spiffin (2006-06-16 11:03:09)
Offline
Re: Different background image per article
You may use
<txp:php>echo $thisarticle["article_image"];</txp:php>
if you don’t want to change your existing articles ;)
http://cssbased.com/ – designers love nature
Offline
Re: Different background image per article
mkavici wrote:
You may use…
Yo, this is Archive, place where old obsolete posts belong Posts that weren’t deleted, but instead archived.
Answering to these is no go, including finding something “current”, more likely you find the answer from somewhere else ;)
Last edited by Gocom (2008-08-25 14:35:41)
Offline
Pages: 1
Topic closed