Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Using article_custom with attribute month
I detected that
<txp:article_custom section='articles' month='2025-07' />
works as documented, but putting the month in a variable
<txp:article_custom section='articles' month="<txp:variable name='d' />" />
doesn’t.
What is the official or recommended way to use the month attribute with variable values?
Are there any usage examples available?
Online
Re: Using article_custom with attribute month
Try switching the quotes around. Use single quotes to denote “process the contained tag and puts its result here”, otherwise double quotes for normal attributes.
<txp:article_custom section="articles" month='<txp:variable name="d" />' />
And your variable d
should take the form YYYY or YYYY-MM. You can use the format attribute to output dates in other formats using strftime notation, e.g. format="%Y-%m"
…
TXP Builders – finely-crafted code, design and txp
Offline