Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-03-31 17:23:47

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 146
Website

txp:yield and txp:php are not friends

I have the following code in a form

<!-- '<txp:yield />' -->
<txp:php>
    print( '<!-- <txp:yield /> -->' ) ;
</txp:php>

The resulting output when called with “tools” as the form content is

<!-- 'tools' -->
<!--  -->

So, txp:yield is not working inside txp:php. How do I fix this?

Offline

#2 2018-03-31 17:48:44

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,611
Website

Re: txp:yield and txp:php are not friends

Try:

<!-- '<txp:yield />' -->
<txp:php>
    echo parse('<!-- <txp:yield /> -->');
</txp:php>

In php you can either call the function name directly or you have to run it through parse ('…');. The case of yield is a special one because that function name already exists in php.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2018-03-31 22:49:28

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 146
Website

Re: txp:yield and txp:php are not friends

Adding parse() makes everything work beautifully. Thank you!

Offline

Board footer

Powered by FluxBB