Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Today 03:08:44

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

[SOLVED] yields

Hey all,

I have the following structure for a shortcode:

<li <txp:if_yield name="lang"> lang='<txp:yield name="lang" />'</txp:if_yield>>

The problem is that the parsed result is <li lang='el'> and not <li lang="el">. Am I missing something or have I hit a limit of the yield 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 Today 03:37:18

phiw13
Plugin Author
From: East Asia
Registered: 2004-02-27
Posts: 3,692
Website

Re: [SOLVED] yields

Try this:

<li <txp:yield name="lang" wraptag='lang="<+>"' />> test</li>

In low-power mode.
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#3 Today 06:39:30

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

Re: [SOLVED] yields

Thanks so much Philippe,

For prosperity this works without adding a space if the yield name is not included.

<li<txp:yield name="lang" wraptag=' lang="<+>"' />>test</li>

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 Today 07:36:10

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,323
Website GitHub

Re: [SOLVED] yields

Hi Yiannis, I mostly do it like you have shown but your original code should also work just fine. You can just use normal double-quotes in your code there because it’s not a tag-in-tag situation, it’s regular code inside a container.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB