Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-10-01 12:36:07
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
category problem
Hello,
I have first a homepage of the category “voorpagina”.
Then you can choose for a subject of the category “dagboek”.
But then you see the articles of voorpagina and dagboek.
My page template looks like this :
<div id=“right”>
<txp:if_section name=”“>
<txp:article_custom section=“voorpagina” form=“default” />
</txp:if_section>
<txp:if_category name=“zwangerschap”>
<txp:article limit=“1” form=“dagboek” sort=“Posted asc” />
<txp:ob1_pagination outputlastfirst =“0” outputnextprevious=“0” />
</txp:if_category>
</div>
What went wrong here ?
Roelof
Offline
Re: category problem
Not totally sure what you are after Roelof but how about this:-
<div id="right">
<txp:if_section name=",default">
<txp:if_category name="zwangerschap">
<txp:article limit="1" form="dagboek" sort="Posted asc" />
<txp:ob1_pagination outputlastfirst ="0" outputnextprevious="0" />
<txp:else />
<txp:article_custom section="voorpagina" form="default" />
</txp:if_category>
</txp:if_section>
</div>
Last edited by thebombsite (2008-10-01 14:45:01)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#3 2008-10-01 14:54:26
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: category problem
Hoi Thebombsite.
What i want is that the category “voorpagina” wil be on the first page and not a any other place.
the section for this is default
The category “zwangerschap will be on the next pages and the section for this is article.
Roelof
P.S. problem solved but i have one guestion.
What will be if a want to add a category “gastenboek”.
Thank you for the help.
Last edited by roelof (2008-10-02 08:52:02)
Offline
Re: category problem
That depends. If this is for another page template then just use a modified version of the code above. If you want to add it to the same template as you’ve used above then there are 2 possible options. If all the contained code inside the tags would apply to both categories (including all the attributes) then you could simply add it as a comma-separated list like <txp:if_category name="zwangerschap,gastenboek">
however, if you maybe need to use different forms for each output, then just add a modified block for the new category under the existing one so you end up with 2 “if_category” blocks.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#5 2008-10-02 15:31:41
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: category problem
Oke,
If i understand you the code will be :
<div id="right">
<txp:if_section name=",default">
<txp:if_category name="zwangerschap">
<txp:article limit="1" form="dagboek" sort="Posted asc" />
<txp:ob1_pagination outputlastfirst ="0" outputnextprevious="0" />
<txp:else />
<txp:article_custom section="voorpagina" form="default" />
</txp:if_category>
<txp:if_category name="gastenboek">
code for the guestbook
</txp:if_category>
</txp:if_section>
</div>
Roelof
Last edited by roelof (2008-10-02 15:32:25)
Offline
Re: category problem
Yep.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#7 2008-10-03 08:10:59
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: category problem
Hoi the bombsite.
Sorry but it doesn’t work.
Now i get the article of voorpagina and the articles of gastenboek on one page where only the articles of gastenboek must show.
My code is :
<div id="right">
<txp:if_section name=",default">
<txp:if_category name="zwangerschap,jaar1, jaar2, jaar3, jaar4">
<txp:article limit="1" form="dagboek" sort="Posted asc" />
<txp:ob1_pagination outputlastfirst ="0" outputnextprevious="0" />
<txp:else />
<txp:article_custom section="voorpagina" form="default" />
</txp:if_category>
<<txp:if_category name="gastenboek">
<txp:article form="default" sort="Posted asc" />
</txp:if_category>
</txp:if_section>
</div>
Roelof
Offline
Re: category problem
Try this.
<div id="right">
<txp:if_section name=",default">
<txp:if_category name="zwangerschap,jaar1,jaar2,jaar3,jaar4">
<txp:article limit="1" form="dagboek" sort="Posted asc" />
<txp:ob1_pagination outputlastfirst ="0" outputnextprevious="0" />
</txp:if_category>
<txp:if_category name="gastenboek">
<txp:article form="default" sort="Posted asc" />
</txp:if_category>
<txp:if_category name="zwangerschap,jaar1,jaar2,jaar3,jaar4,gastenboek">
<txp:else />
<txp:article_custom section="voorpagina" form="default" />
</txp:if_category>
</txp:if_section>
</div>
Hope that works. Notice there should not be any gaps in a “comma-separated list”. This will be easier when we have 4.0.7 because we will be able to nest tags within themselves.
Last edited by thebombsite (2008-10-04 13:23:13)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#9 2008-10-04 15:58:19
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: category problem
Thank you,
It works.
Now puzzeling to find the right url for the guestbook.
Roelof
Offline
Pages: 1