Textpattern CMS support forum

You are not logged in. Register | Login | Help

#131 2017-11-13 15:44:53

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,223
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

jakob wrote #245939:

Cool! and cunning. That works!

BTW: for those, like me, who may not initially understand the logic, it is ESSENTIAL to insert SMD_NONE (or a non-word of your choice) as the default value in the attributes section above the code:

I am checking an amended version of this macro out but it seems to be chocking after it parses the image tag

In the macro I have

<figure itemscope itemtype="http://schema.org/ImageObject" class="{class}">
<txp:image id="{img_id}" />
<txp:smd_if field="{caption}" operator="eq" value="SMD_NONE">
<figcaption><txp:image_info id="{img_id}"> type="caption" /></figcaption>
<txp:else />
<txp:smd_if field="NULL" operator="eq" value="{caption}">
<txp:else />
<figcaption>{caption}</figcaption>
</txp:smd_if>
</txp:smd_if>
</figure>

The tag I use in the write tab is

<txp:figure id="58" caption="my caption" class="grid_9"  />

the parsed code is

<figure itemtype="http://schema.org/ImageObject" class="grid_9">
<img src="http://respublika.neme.org/images/58.jpg" alt="" width="350" height="240" />

There is no figcaption and the closing figure.

Can anyone spot what I am doing wrong? I am using the 0.41 version of the plugin.


Yiannis
——————————
neme.org | hblack.net | LABS | NeMe @ github

Online

#132 2017-11-13 15:52:48

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 621
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

A > to much —> <txp:image_info id="{img_id}" type="caption" /> ?

See the bad syntax highlighting …

Last edited by jpdupont (2017-11-13 15:54:10)

Offline

#133 2017-11-13 16:09:32

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,223
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

Thanks so much jp… I was so blind to it… It’s now working as intended


Yiannis
——————————
neme.org | hblack.net | LABS | NeMe @ github

Online

Board footer

Powered by FluxBB