Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2023-03-06 16:56:19
- bashirnoori
- Member
- From: Afghanistan
- Registered: 2012-10-02
- Posts: 79
How to list articles of each category in txp:category_list
I’m making a Restaurant Menu, there are two main category (Lunch & Dinner) then other nested categories are in main categories, finally I’m adding each menu to specific category.
Now, I want to list all category and the articles of each category should list, I’m trying the following codes but not works.
<txp:category_list break="" categories='<txp:category_list parent="lunch" exclude="lunch" wraptag="" break=","><txp:category /></txp:category_list>'>
<div class="category">
<h2><txp:category title="1" /></h2>
<txp:article_custom category="<txp:category title='0' />">
<h3><txp:title /></h3>
</txp:article_custom>
</div>
</txp:category_list>
Attached Example: link
Last edited by bashirnoori (2023-03-06 17:14:08)
Offline
Re: How to list articles of each category in txp:category_list
Would this work?
<txp:category_list parent="lunch" exclude="lunch" break=",">
<txp:category title="1" />
<txp:article_custom category='<txp:category />' wraptag="h3" limit="999">
<txp:title />
</txp:article_custom>
</txp:category_list>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#3 2023-03-07 05:06:43
- bashirnoori
- Member
- From: Afghanistan
- Registered: 2012-10-02
- Posts: 79
Re: How to list articles of each category in txp:category_list
I just changed the “ to ‘ and now works fine !
This was my old code:
<txp:article_custom category="<txp:category title='0' />">
And this is the new code:
<txp:article_custom category='<txp:category title="0" />'>
Last edited by bashirnoori (2023-03-07 05:09:09)
Offline