Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-06-13 08:04:09

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

links in shortcodes

I am studying the image with caption shortcode in combination with the escape attribute and I can not see of any way that I can include html links in the caption. Can someone point to me what I am missing?

This is what I am trying to achieve

<txp::figure id="130" class="photo" caption="The throne of <a rel="external" href="https://en.wikipedia.org/wiki/Zeus">Zeus</a> at Mount Olympus." />

Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#2 2018-06-13 09:05:46

etc
Developer
Registered: 2010-11-11
Posts: 4,706
Website GitHub

Re: links in shortcodes

Quotes, sir! Try

<txp::figure id="130" class="photo" caption='The throne of <a rel="external" href="https://en.wikipedia.org/wiki/Zeus">Zeus</a> at Mount Olympus.' />

Offline

#3 2018-06-13 11:32:37

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

Re: links in shortcodes

That was it! How could I have missed that one:)


Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#4 2022-11-05 14:53:49

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 114
Website

Re: links in shortcodes

I’m trying this very thing, cut and paste the figure code into a form named figure and using the short code, but the image doesn’t show up at all. Nothing shows up in the page source. Short tag support is enabled in preferences. I just can’t figure what could go wrong…

james

Offline

#5 2022-11-06 06:21:32

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,907
Website GitHub Twitter

Re: links in shortcodes

jrmartin wrote #334086:

I’m trying this very thing, cut and paste the figure code into a form named figure and using the short code, but the image doesn’t show up at all. Nothing shows up in the page source. Short tag support is enabled in preferences. I just can’t figure what could go wrong…

james

Hi James,

The shortcode above is for use in the articles. Before using it you have to copy/paste the code below in presentations/forms>create a new, miscellaneous form and call it figure.

<txp:if_yield name="caption">
<figure<txp:if_yield name="class"> class="<txp:yield name="class" />"</txp:if_yield>>
<txp:images id='<txp:yield name="id" />'><img itemscope itemtype="http://schema.org/ImageObject" loading="lazy" src="/images/<txp:yield name="id" /><txp:image_info type="ext" />" width="<txp:image_info type="w" />" height="<txp:image_info type="h" />" alt="<txp:image_info type="alt" default="Image" />" /></txp:images>
<figcaption class="grid_24"><txp:yield name="caption" escape="tidy,textile" /></figcaption>
</figure>
<txp:else />
<txp:images id='<txp:yield name="id" />'><img itemscope itemtype="http://schema.org/ImageObject" loading="lazy" src="/images/<txp:yield name="id" /><txp:image_info type="ext" />" width="<txp:image_info type="w" />" height="<txp:image_info type="h" />" alt="<txp:image_info type="alt" default="Image" />" class="<txp:yield name="class" default="image" />" /></txp:images>
</txp:if_yield>

Yiannis
——————————
neme.org | hblack.net | EMAP | A Sea change | NeMe @ github
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB