Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-01-04 03:41:03
- reptilerobots
- Member
- Registered: 2005-08-20
- Posts: 72
assign class to <txp:article_image /> ?
I have a simple form that displays the article image and links to the next and previous articles underneath it.
<code>
<txp:article_image />
<div id=“arrows”>
<txp:link_to_prev><< previous</txp:link_to_prev>
<txp:link_to_next>next >></txp:link_to_next></div>
</code>
I want to assign a class to the article_image, but when I try something like <code><txp:article_image class=“border” />, nothing happens. The div id works fine for the links underneath though. I am still pretty new to TXP, and I am uncertain as to whether classes can be assigned to txp:article_image if its output from a form…. but I would assume it would work.
Offline
#2 2006-01-04 04:46:31
- reptilerobots
- Member
- Registered: 2005-08-20
- Posts: 72
Re: assign class to <txp:article_image /> ?
weird – apparently I can wrap a div around it, and target the “img” tag – but I cannot get a border around it through external css
Offline
Re: assign class to <txp:article_image /> ?
I don’t think article_image can take a class attribute. You best bet would be to use a wrapper dive around the tag and target the image in that.
<code>
<div class=“article_image”><txp:article_image></div>
</code>
<pre>
<code>
div.article_image img {
border:1px solid#ccc;
}
</code></pre>
Last edited by hakjoon (2006-01-04 05:07:25)
Shoving is the answer – pusher robot
Offline
#4 2006-01-04 15:35:24
- reptilerobots
- Member
- Registered: 2005-08-20
- Posts: 72
Re: assign class to <txp:article_image /> ?
thanks – will try that
Offline
#5 2006-01-31 07:21:10
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: assign class to <txp:article_image /> ?
hakjoon wrote:
I don’t think article_image can take a class attribute. You best bet would be to use a wrapper dive around the tag and target the image in that.
I’ve just run into the same problem. It seems silly that this tag should take a style
attribute, but not class
. I thought we were all supposed to be avoiding inline styles these days, right?
Offline
Pages: 1