Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2020-07-02 12:18:52

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,892
Website

Re: Getting a txp:variable that's been set in article body... possible?

philwareham wrote #324193:

If there is a cleaner way, please let me know, otherwise I’m happy this is working.

How about:

<txp:hide process><txp:body /></txp:hide>

Almost the same: no output but processed contents but also no variable needed.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2020-07-02 12:38:11

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,337
Website

Re: Getting a txp:variable that's been set in article body... possible?

jakob wrote #324194:

How about …

Didn’t work for my particular use case. Hiding the body seems to hide the variable too.

Offline

#13 2020-07-02 17:06:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,637
Website

Re: Getting a txp:variable that's been set in article body... possible?

philwareham wrote #324193:

FYI I tried Stef’s <txp:custom_field name="body" /> suggestion but that output actual contents of body.

Ah yeah, not what you want in this case.

Hiding the body seems to hide the variable too.

Odd, it works for me. Article body content:

<txp:variable name="testing">TESTING</txp:variable>

Default form:

<txp:hide process><txp:body /></txp:hide>
HAZ <txp:variable name="testing" />

<div itemprop="articleBody">
    <txp:body />
</div>

Output:
HAZ TESTING
… rest of body


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB