Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Today 06:41:08

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,678
GitHub Twitter

Occurrences in a "yield" tag

Is it possible (and how) to verify different occurrences into a single conditional yield tag?

For compatibility with a previous short code, I need verify two occurrences into the new one.

The pipe sign seems not working:

<txp:if_yield name"old|new">
...do something wired...
</txp:if_yield>

🤔 💭


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 Today 07:51:35

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

Re: Occurrences in a "yield" tag

Do you need both occurrences to be true? If so try

<txp:if_yield name="old">
<txp:if_yield name="new">
...do something wired...
</txp:if_yield>
</txp:if_yield>

if only one occurrence is enough, you may need to call the yield twice.

<txp:if_yield name="old">
...do something wired...
</txp:if_yield>
<txp:if_yield name="new">
...do something wired...
</txp:if_yield>

Edited to add that there appears to be a typo in your snippet. If the pipe works, it should be

<txp:if_yield name="old|new">
...do something wired...
</txp:if_yield>

Last edited by colak (Today 07:53:05)


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