Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-29 21:56:06

tennapel
Member
Registered: 2009-05-31
Posts: 62

[textile] Textile: wrapping a txp:image tag in a span with a class

Textile sometimes eludes me. If I want to insert an image in an artikel, I can use the txp:image tag, no problem. But If I want to warp the tag in a span, textile plays tricks.

%(bijschrift)<txp:image id="17" />%

results in

<p><span style="text-align:left;" class="bijschrift">txp:image id=“17” /></span></p>

instead of

<span class="bijschrift"><img src="plaatje.jpg" /></span>

The opening ‘greater than’ sign of the tag is interpreted as a align-left command. I cannot escape it. How to solve this?

Offline

#2 2009-07-29 22:32:22

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

Re: [textile] Textile: wrapping a txp:image tag in a span with a class

You could add a space before the code to prevent the <p> tags being added, but it looks like Textile can’t handle the Txp tag inside the %. This however would do the same:

<txp:image wraptag="span" class="bijschrift" id="17" />

Offline

#3 2009-07-30 17:57:15

tennapel
Member
Registered: 2009-05-31
Posts: 62

Re: [textile] Textile: wrapping a txp:image tag in a span with a class

Els wrote:

You could add a space before the code to prevent the <p> tags being added, but it looks like Textile can’t handle the Txp tag inside the %. This however would do the same:

<txp:image wraptag="span" class="bijschrift" id="17" />

Yes, it would be the same, but I like to include text AFTER the image tag, but within the SPAN. That’s why I tried the previous example. Surely, I most not be the first person who has ever tried to enclose an txp:image tag within a tag? The alternative would be to program my own tag, but I’d like to avoid that!

Offline

#4 2009-07-30 21:00:44

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

Re: [textile] Textile: wrapping a txp:image tag in a span with a class

tennapel wrote:

but I like to include text AFTER the image tag, but within the SPAN.

Ah, I see. Textile seems to be choking on the opening < of the Txp tag. The only way I can get it working is by adding something (anything, just not a space) before it. This works for example:

%(bijschrift)&nbsp;<txp:image id="17" /> some text here%

It’s a workaround, but not very pretty…

Last edited by els (2009-07-30 21:02:06)

Offline

#5 2009-07-31 13:02:12

trenc
Plugin Author
From: Malmö
Registered: 2008-02-27
Posts: 572
Website GitHub

Re: [textile] Textile: wrapping a txp:image tag in a span with a class

Maybe yab_image is a solution for you, if I interpret your issue correctly.

Offline

#6 2009-08-05 09:07:33

tennapel
Member
Registered: 2009-05-31
Posts: 62

Re: [textile] Textile: wrapping a txp:image tag in a span with a class

@trenc: thankx, I will give it a try. As far as I can tell from the description it is indeed the solution for my problem.

Offline

#7 2009-08-07 05:55:51

tennapel
Member
Registered: 2009-05-31
Posts: 62

Re: [textile] Textile: wrapping a txp:image tag in a span with a class

In the end, i took another route. Since the image + caption was placed at the start of an article, I have wrapped it in a paragraph:

p(bijschrift). <txp:image id="1" /> The Caption text

This works perfectly

Offline

Board footer

Powered by FluxBB