Possible to create figures in Text Editor?

Shopify Partner
115 0 7

How do you create figures in the text editor?

I don't see a way to do it, but figures are very common in blogs and articles so it's hard to believe it would be completely left out of a text editor that is going to be used for that.

0 Likes
Shopify Partner
1341 22 203

I you can add a custom font face if you edit your product or blog post text as HTML. Just add something like <span class="my-font-face"></span>.

Not very handy I'm afraid but it will work.

https://sections.design tips, tricks & Shopify sections
0 Likes
Shopify Partner
115 0 7

Yeah, I can't really rely on teaching clients HTML.

0 Likes
Shopify Expert
9764 86 1512

Hey Halley - I assume you're talking about the HTML <figure> right? There's no simple option to do this in the RTE without editing the HTML directly. You certainly could add some JavaScript to wrap images in figures.

With some crafty Liquid string manipulation you might also be able to do this in Liquid as well. There's a lot of caveats in that approach.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Shopify Partner
1341 22 203

Hmmm, I thought he was reffering "figures" to emojis, smily faces... not the figure element.

https://sections.design tips, tricks & Shopify sections
0 Likes
Shopify Partner
115 0 7

I am indeed referring to HTML figures where you have an image and a figcaption. I've never heard of emojis being called figures.

I don't really like trying to parse the output of the rte whether it's with javascript or liquid. The structure of the output is very unreliable(it randomly started wrapping lists in divs recently which broke a JS parser I was using).

There is also the issue with determining which images and text should be inside a figure and which should just be an image with a paragraph after it. I'm not sure how I would do that without implementing some sort of identefier that the user could put in to signify the start and end of a figure, which wouldn't be much better than just teaching them HTML.

0 Likes
Shopify Partner
1341 22 203

Sorry, my bad. But it remains the same issue. Without hardcoded markup you can only parse and hope that some unclosed tag or crazy nesting will not break the parser.

 

https://sections.design tips, tricks & Shopify sections
0 Likes