Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-01 22:13:48

alannie
Member
From: Minnesota, USA
Registered: 2005-09-15
Posts: 150

Insert only the URL to an article image?

Hello, I would like to use an article image as the background image in some inline CSS. The problem is, the <code><txp:article_image /></code> tag inserts height, width, alt, etc. which won’t work within a CSS background rule. Is there a way to call up only the URL?

Here’s the context:

<code><div style=“background: url(<txp:need_article_image_url_here />);”> </div></code>

Ideas?

Offline

#2 2006-02-01 22:20:07

alannie
Member
From: Minnesota, USA
Registered: 2005-09-15
Posts: 150

Re: Insert only the URL to an article image?

Never mind, after trying some different search terms, I found the answer. :)

Offline

#3 2006-02-01 22:24:50

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Insert only the URL to an article image?

One way that comes to my mind is not using the article image field, but a custom field for the article image id. Then this
<code>
<div style=“background: url(/images/<txp:custom_field name=“image” />.jpg);”> </div>
</code>
might work?

Edit: ah, too late…

Last edited by doggiez (2006-02-01 22:26:08)

Offline

#4 2008-04-17 16:01:01

beechy
Member
Registered: 2006-03-02
Posts: 92

Re: Insert only the URL to an article image?

Hi alannie,

what solution to this did you use in the end I need to do exactly the same thing

the link in

Never mind, after trying some different search terms, I found the answer. :)

no longer works

Last edited by beechy (2008-04-17 16:01:35)

Offline

#5 2008-04-17 16:11:46

alannie
Member
From: Minnesota, USA
Registered: 2005-09-15
Posts: 150

Re: Insert only the URL to an article image?

Oh gosh, that was a long time ago. I used the upm_image_popper plugin with a tag that let me customize the article image display with a form.

<txp:upm_article_image form="image_background" />

Offline

#6 2008-04-17 21:57:16

beechy
Member
Registered: 2006-03-02
Posts: 92

Re: Insert only the URL to an article image?

thanks will try it out

Offline

Board footer

Powered by FluxBB