Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
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
Re: links in shortcodes
That was it! How could I have missed that one:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
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
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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Pages: 1