Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Dynamically display content from second article on first article?
On the page for article A, I would like to display some content from article B. Articles A & B are in the same section, and article B is “sticky”.
This code seems like it should work, but it doesn’t.
<txp:article_custom section="<txp:section link="0" title="0" />" status="sticky">
<li><txp:title /> <br>
<txp:meta_description format="" /></li>
</txp:article_custom>
Or, is there a better way to do this?
Offline
Re: Dynamically display content from second article on first article?
I expect the reason it doesn’t work is your use of quotes. If you want to process the stuff inside the section
attribute as a txp: tag and have it consider the output of that tag rather than the actual string content of what you typed, you’ll need to surround it with single quotes:
<txp:article_custom section='<txp:section link="0" title="0" />' status="sticky">
...
See parsed attribute values for more insight.
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
Re: Dynamically display content from second article on first article?
Thank you so much. That worked.
I spent hours on that. I thought about the quotes and never tried it. Thank you!
Offline