Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-07-23 09:00:48

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

if_custom_field new attributes

Can somebody post some examples on how to use the new match and separator attributes in the if_custom_field tag?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2011-07-23 09:29:10

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: if_custom_field new attributes

And please write them in the if custome field docs.

Offline

#3 2011-07-24 12:42:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: if_custom_field new attributes

taking inspiration from aam_split_custom_field a code that should does work -but it does not in my tests is:

<txp:if_custom_field name="zoo_animals" separator="," match="any" value="monkeys">  
<p>The monkeys are eating bananas.</p>
<txp:else />
<p>The bears ate all the monkeys. How sad.</p>
</txp:if_custom_field>

A real world example can be found here

Last edited by colak (2011-07-25 03:33:27)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2011-07-25 04:26:31

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,258
Website GitHub Mastodon Twitter

Re: if_custom_field new attributes

added the example above in the textbook

Last edited by colak (2011-07-25 04:27:26)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB