Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2008-02-22 17:24:56
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How can i exclude categories from a list
OK. Give me some more time and I’ll try to figure it out :)
Offline
#14 2008-02-22 17:58:51
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
oke Els,
Take your time. If a need to clarify something , you can ask me.
Roelof
Offline
#15 2008-02-22 20:20:46
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
hello Els,
I was looking into the plugin section and i found this plugin : zoo_section_and_category_list
I will try if this can work.
Roelof
Offline
#16 2008-02-22 20:22:31
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How can i exclude categories from a list
Ok, great! Let us know if/when it works.
Offline
#17 2008-02-23 10:42:58
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
Hello Els,
I don’t think i will work.
This plugin puts everything in a <li> tag and i need that the categories are in a <ul> tag and the sections in a <li> tag.
Roelof
Offline
#18 2008-02-23 18:55:29
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
hello els,
I was playing with your code and this code looks very good :
<txp:if_article_category name=”,voorpagina”>
<txp:else />
<ul id=“rgaccordmenu”>
<li>
<span class=“toggle”>
<txp:if_different>
<txp:category1 title=“1” />
</txp:if_different>
</span>
<ul class=“content”>
<li>
<txp:if_different>
<txp:section title=“1” />
</txp:if_different>
</li>
</ul>
</li>
</ul>
But now if when you put another month this script is making two list instead of 1 list.
And nesting <if_different> doesn’t work because then i get very strange output.
Regards,
Roelof
Offline
#19 2008-02-23 22:04:54
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How can i exclude categories from a list
Yes, I was playing with this code in my test install and noticed the same thing. I’ll see if I can get it working.
Would it be a problem for you if you use sections for ‘zwangerschap’, ’1e levensjaar’, etcetera, and the posted date to show the months? You would need no categories then, and it would simplify the code you need I think.
Offline
#20 2008-02-24 10:13:35
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
hello Els,
Can you explain what you mean ?
If a still have the same menu as in my old site , it’s not a problem.
All the articles get the same posted date as the day it happen.
Offline
#21 2008-02-24 16:59:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How can i exclude categories from a list
Ok, this will work. You will need to install asy_wondertag, and create your sections like this:
Section name: 00-zwangerschap, section title: Zwangerschap
Section name: 01-1e-levensjaar, section title: 1e levensjaar
etcetera
(this is to be able to show them in the right order)
Don’t create a section ‘default’, you don’t need it and it will mess things up.
Use a section ‘voorpagina’ for the article on the front page, but give the article status ‘sticky’. Make sure that this section is the only one that has ‘on front page’ set to ‘yes’. Use sticky articles for other sections like ‘contact’ too. To display the sticky articles you’d need <txp:article status="sticky" />
. If you are using one page template for all sections, you need something like this:
<txp:if_section name=",contact,gastenboek">
<txp:article status="sticky" />
<txp:else />
<txp:article />
</txp:if_section>
Delete all your categories :)
For the menu, I don’t think it is possible to use nested lists with if_different. So I used <h3>
and <h4>
for the sections and months, and <ul>
for the articles.
On the page, in the left column:
<div id="rgaccordmenu">
<txp:article_custom form="navigation" sort="section asc, posted asc" />
<!-- this is the menu for 'Zwangerschap, 1e levensjaar etcetera -->
<txp:section_list sections="gastenboek,contact" wraptag="ul" break="li" />
<!-- this is the menu for all other sections -->
</div>
Article form ‘navigation’:
<txp:if_first_article>
<div style="display:none;">
<!-- this is a workaround because otherwise there is a </div> at the start -->
</txp:if_first_article>
<txp:if_different>
</div><!-- closing div.content -->
<h3 class="toggle"><txp:section title="1" /></h3>
<div class="content">
</txp:if_different>
<txp:if_different>
<h4 class="toggle2"><txp:posted format="%B %Y" /></h4>
</txp:if_different>
<txp:if_different>
<txp:asy_wondertag><txp:article_custom section="<txp:section />" month="<txp:posted format="%Y-%m" />" form="article_list" sort="posted asc" /></txp:asy_wondertag>
</txp:if_different>
<txp:if_last_article>
</div><!-- closing div.content -->
</txp:if_last_article>
Article form ‘article_list’:
<txp:if_first_article>
<ul class="content2">
</txp:if_first_article>
<li><txp:permlink><txp:title /></txp:permlink></li>
<txp:if_last_article>
</ul>
</txp:if_last_article>
Now because you are not using nested lists anymore, you will need to change the following in menu.js:
'span.toggle', 'ul.content'
—> 'h3.toggle', 'div.content'
'span.toggle2', 'ul.content2'
—> 'h4.toggle2', 'ul.content2'
li span.toggle
—> h3.toggle
span.toggle2
—> h4.toggle2
Your menu will function exactly as it does now on your old site, BUT you will need to make some changes to the CSS to style it exactly the same way :)
Last edited by els (2008-02-24 17:03:19)
Offline
#22 2008-02-24 19:04:18
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
Hello Els,
Thank you very much, it works. I only deleted one part which displays the articles in the menu.
What i was looking for was a menu of months and if someone choose a month, he/she sees all the articles of that month.
Regards,
Roelof
Offline
#23 2008-02-24 20:18:59
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How can i exclude categories from a list
Ah ok, I just tried to rebuild your original menu. I’m glad it works!
Offline