Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
custom field ruining css style?
is it possible that using a custom field can muck up the css or xhtml?
this is an image gallery thing – and if i use the custom field which is a url, then the alignment and everything goes nuts. if not, it looks fine. i’ve tried a few urls so i can’t be that. regardless of if it’s a custom field or not, the image and text is still hyperlinked in some way.
<div class="thumbnail">
<txp:if_custom_field name="randomcust">
<a href="<txp:custom_field name="randomcust" />"><txp:article_image thumbnail="1" /></a>
<txp:else />
<txp:permlink> <txp:hak_article_thumb limit="1" link="0"/></txp:permlink> <br />
</txp:if_custom_field>
<txp:if_custom_field name="randomcust">
<a href="<txp:custom_field name="randomcust" />"><txp:title /></a> <br />
<txp:else />
<txp:permlink><txp:title /></txp:permlink> <br />
</txp:if_custom_field>
one other difference in the View Source is:
the non-custom field ones that txp generated using permlink goes: a rel=“bookmark” href=”“
and the custom field one goes a href=”“
Last edited by mrtunes (2009-02-02 22:53:16)
Offline
Re: custom field ruining css style?
mrtunes wrote:
is it possible that using a custom field can muck up the css or xhtml?
Yes if it contains escapable stuff. In 4.0.7 and above, txp:custom_field (among others) escapes all output by default so your beautifully crafted links get mangled. Try adding escape=""
to your custom field tag and see if that fixes it.
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
Offline
Re: custom field ruining css style?
yes i forgot to mention i tried that, sorry!
Offline
#4 2009-02-02 23:16:01
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: custom field ruining css style?
I notice the ‘custom’ linked thumbnail is not followed by a <br />
while the permlinked one is.
Offline
Re: custom field ruining css style?
Els wrote:
I notice the ‘custom’ linked thumbnail is not followed by a
<br />
while the permlinked one is.
i spy my little eye, something that is WRONG! you guys are unstoppable. thanks els!
while i’m here do you folks recommend using definition lists for image galleries like this? or are they unnecessary for the code i’ve posted above?
Offline
#6 2009-02-02 23:28:29
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: custom field ruining css style?
I’d put them in an unordered list rather than in a definition list, but you’d have to ask the markup specialists if some kind of list is required for an image gallery at all.
Offline
Re: custom field ruining css style?
Els wrote:
I’d put them in an unordered list rather than in a definition list, but you’d have to ask the markup specialists if some kind of list is required for an image gallery at all.
ok, currently they are in no list format, txp just spits them out and i play with the CSS to style the boxes. i was just reading that definition lists are better.
Offline
Pages: 1