Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2022-10-13 21:20:28

etc
Developer
Registered: 2010-11-11
Posts: 4,701
Website GitHub

Re: Glossary architecture

That’s working for me in 4.8.8. You just must make sure that <txp:variable[-1] /> is on the same or above tree level that <txp:article />, i.e.

<txp:variable[-1] name="item_from_article" wraptag="h2" class="my-class" />
<txp:if_individual_article>
    <txp:article form="article_single" listform="article_single" limit="1" />
</txp:if_individual_article>

should work, but

<txp:if_individual_article>
    <txp:variable[-1] name="item_from_article" wraptag="h2" class="my-class" />
</txp:if_individual_article>
<txp:article form="article_single" listform="article_single" limit="1" />

won’t. Here <txp:variable[-1] /> will be processed as the last tag within <txp:if_individual_article /> block. But the block itself will be processed before <txp:article />. If this is your case, <txp:hide /> is fine:

<txp:if_individual_article>
    <txp:hide process="2">
        <txp:variable[-1] name="item_from_article" wraptag="h2" class="my-class" />
    </txp:hide>
</txp:if_individual_article>
<txp:article form="article_single" listform="article_single" limit="1" />

will be transformed into

    <txp:hide process="2">
        <txp:variable[-1] name="item_from_article" wraptag="h2" class="my-class" />
    </txp:hide>
<!-- processed article output, the variable is defined here -->

after the first pass, and <txp:hide /> will be output in the second pass.

Offline

#62 2022-10-13 21:57:52

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

Re: Glossary architecture

Could my problem be resulting from the fact that this is a “static” section landing page so strictly-speaking both parts of tag-pair are in article_list context. It’s just that the form set in listform shows the full output for a single article.

PS: Oh, and thanks for the lightning-fast response!


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB