Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 Yesterday 20:02:39

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,152
Website Mastodon

Re: Adding a caption to an image output by the Article Image field

jakob wrote #341178:

<txp:image_info wraptag="figcaption" class="myclass" />...

… you can avoid an empty figcaption being output if you don’t specify a caption.

yes that was magic. as before adding that, if one deleted the caption it still showed an outline around an empty string ( part of my css).

thanks all! I have it working fine. here is what I have

<txp:if_article_image>
 <txp:images>
   <figure>
    <txp:image />
   <txp:image_info wraptag="figcaption" class="velocaption" /> </figcaption>
 <figure>
</txp:images>
</txp:if_article_image>

and I had to add the css for the class directly in the TxP form as it was never working by editing my css files… probably due to a lot of css crud in my style sheets. anyways for three captions it is good enough, for now. I will, in time correct the css style sheets, and get it working from that procedure . I am looking at the Powell course next week.


…. texted postive

Offline

#14 Yesterday 20:54:37

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,053
Website GitHub

Re: Adding a caption to an image output by the Article Image field

bici wrote #341188:

thanks all! I have it working fine. here is what I have

One tiny correction necessary: you can drop the closing </figcaption> – the wraptag attribute does that for you.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB