Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
nested menu
I’m experimenting on my localhost with Els’ code here
<txp:category_list children="0" wraptag="ul" break="">
<li class="cat"><txp:category title="1" link="1" />
<txp:category_list parent='<txp:category />' exclude='<txp:category />' wraptag="ul" break="" class="subcat_list">
<li><txp:category title="1" link="1" /></li>
</txp:category_list>
</li>
</txp:category_list>
I’m wondering if there is a way to include linked articles in there too. Thinking of ways to create a linked nested menu
- category 1
- article 1
- article 2
- category 2
- sub-category 2a
- article 3
- article 4
- sub-category 2b
- article 5
- sub-category 2a
- category 3
- article 6
etc
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#2 2010-03-28 10:28:26
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: nested menu
colak wrote:
I’m wondering if there is a way to include linked articles in there too.
Do you mean like this?
<txp:category_list children="0" wraptag="ul" break="">
<li class="cat"><txp:category title="1" link="1" />
<txp:category_list parent='<txp:category />' exclude='<txp:category />' wraptag="ul" break="" class="subcat_list">
<li><txp:category title="1" link="1" /></li>
<txp:article_custom category='<txp:category />'>
<li><txp:permlink><txp:title /></txp:permlink></li>
</txp:article_custom>
</txp:category_list>
</li>
</txp:category_list>
Offline
#3 2010-03-28 10:28:56
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: nested menu
Yiannis,
Have you see this other code from Els.
It seems to create what you need
http://txptips.com/display-section-sensitive-articles-and-category-title
Offline
#4 2010-03-28 10:30:47
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: nested menu
jpdupont wrote:
Have you see this other code from Els.
Haha, I forgot that was already a TXP Tip :)
Offline
Re: nested menu
Els wrote:
Do you mean like this?
Yep:) I think that it will work! I’m trying different layouts on my localhost so as to relaunch neme.org.
jpdupont wrote:
Yiannis, Have you see this other code from Els.
Thanks jp. Wil have a look at that too:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: nested menu
No it doesn’t work as it does not parse articles which belong to parent categories
This is where I am at
<ul><li><a href="<txp:site_url />">Home</a></li>
<txp:category_list children="0" wraptag="" break="" class="">
<li><txp:category title="1" link="1" />
<ul><txp:article_custom category='<txp:category />' break="li">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom></ul>
<txp:category_list parent='<txp:category />' exclude='<txp:category />' break="" wraptag="ul" class="">
<li><txp:category title="1" link="1" /></li>
<txp:article_custom category='<txp:category />'>
<li><txp:permlink><txp:title /></txp:permlink></li>
</txp:article_custom>
</txp:category_list>
</li>
</txp:category_list></ul>
which does not work either as it produces empty ul
s in parent categories which contain no articles. (all articles in those are in child categories)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Pages: 1