Using Figcaption in <perch:content> areas

  • Hi... I'm building a site where the customer has a text blocks to fill in for content, it's mainly text but they are going to want to insert images randomly in the text in some of the pages.

    They want to be able to add a caption to these images to explain what they are.


    Is there a way for me to allow them to inserti an image via the markitup editor (or another editor) which will allow the (optional) placing of a caption?


    Been scratching my head for an hr working out a way of getting it set up so they can just insert one into a body of text using the figure > figcaption route.


    Any help would be greatly appreciated.

  • Update, been reading up on Redactor 2 editor and it seems by default it wraps inserted images in <figure> tags...

    Not used Redactor myself as an editor in Perch


    Anyone use it and can confirm... site is still in html stage and will be doing the admin early next week so want to get my ducks in a row before I start

  • The Perch implementation of Redactor does not use <figure>. It inserts a cms tag like this [cms:asset 245 title="Image title"] which outputs as an <img> tag with <alt> attribute on the front end.


    There is a Redactor inline assets plugin which adds the image without using the cms tag. I don't know if it uses <figure>.


    https://grabapipit.com/pipits/…actor-inline-perch-assets


    However, if i was doing this, I would use Perch Blocks, with a block for text and an image block using <figure> and <figcaption>. That way, the client can choose each block as needed. And it gives you more control over the HTML.