Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[textile] txp:image_url in article body dont work
Hi!
The code in article body:
<txp:images category="portfolio">
<a href="<txp:image_url />" rel="lightbox-smd"><txp:thumbnail /></a>
</txp:images>
and as a result
<a href="http://www.example.com/images/8.png“ rel=“lightbox-smd”><img src="http://www.example.com/images/8t.png" alt="" width="500" height="375" /></a>
The code
<txp:images category="portfolio">
<txp:image_url><txp:thumbnail /></txp:image_url>
</txp:images>
work perfect, but I need rel=“lightbox-smd” in link tag.
Help me to solve problem, please!
Offline
Re: [textile] txp:image_url in article body dont work
Disable Textile for that block:
notextile. <txp:images category="portfolio">
<a href="<txp:image_url />" rel="lightbox-smd"><txp:thumbnail /></a>
</txp:images>
I’ll send a report to net-carver.
Code is topiary
Offline
Re: [textile] txp:image_url in article body dont work
Thanks!!!
Offline
Re: [textile] txp:image_url in article body dont work
It’s not a bug, as such. Nested tags are notorious for confusing Textile1.
Since this is a simple example you only got some badly encoded quotes in the result. For more complicated blocks of <txp:>
tags you can get all manner of weird results including error messages about missing tags or hunks of content disappearing further down the page.
The quick answer, as Jeff says, is to disable Textile piecemeal. Jeff’s shown one way. You can also use notextile..
to start a multi-line block of code (perhaps your code has blank lines in it which may otherwise turn the parser on and off during the block and cause odd results). You can escape back out of the block when your paragraphs resume with the usual p. some text here...
.
The other way is to start the line on which the troublesome tags start with a couple of spaces. I often do this kind of thing:
Some paragraph text.
<txp:images category="portfolio">
<a href="<txp:image_url />" rel="lightbox-smd"><txp:thumbnail /></a>
</txp:images>
Some more text ...
(note the spaces at the start of each line of code)
You can also surround the entire block with double-equals signs:
==<txp:images category="portfolio">
<a href="<txp:image_url />" rel="lightbox-smd"><txp:thumbnail /></a>
</txp:images>==
If your article contains a lot of TXP tags another option is to turn off Textile entirely for that article (twist open the Advanced Options on the left to reveal the alternatives available) and just manually put HTML tags in where you need them.
The final option is to relegate the block(s) of code to a Form, which means they will not be Textiled at all:
Some paragraph text.
==<txp:output_form form="gallery" />==
Some more text ...
Hope some of that helps.
1 Note to self: write some of this post up as documentation somewhere: is this a Troubleshooting article or should it go in the official Textile documentation (wherever that ends up), or perhaps even in the Write panel prose?
Last edited by Bloke (2010-12-30 14:08:01)
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
Online
Re: [textile] txp:image_url in article body dont work
The lazy man’s guide to turning off textile in an article is right here – maybe this helps too.
Offline