Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Categories: Showing specfic category excerpt list on separate page
Please excuse my ignorance, I could use some help.
Trying to achieve the above after clicking on a specific category out of a list which resides on the default page.
Problem is my code underneath doesn’t take you to a new page where you only have a list of that category’s items.
The url is http:meanttoshine.org/weblog
<txp:if_individual_article>
<txp:article_custom limit=“1” form=“MTS_single” />
<txp:else />
<txp:article_custom limit=“3” form=“MTS_article_default” category=“diverse” sort=“LastMod desc />
<txp:if_category>
<h3>Articles in category <txp:category title=1 />:</h3>
<txp:article limit=“5” />
<txp:else />
<h3>All articles:</h3>
</txp:if_category>
<p>
<txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next></p>
<txp:else />
<p>
<txp:older><txp:text item=“older” /></txp:older>
<txp:newer><txp:text item=“newer” /></txp:newer></p>
</txp:if_individual_article>
I think, therefore I AM, … … er … I think :-?
Offline
Offline
#3 2007-08-11 13:41:49
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Categories: Showing specfic category excerpt list on separate page
A tag trace isn’t needed.
<txp:if_individual_article>
<txp:article limit="1" form="MTS_single" />
<p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /></txp:link_to_next></p>
<txp:else />
<txp:if_category>
<h3>Articles in category <txp:category title="1" />:</h3>
<txp:article limit="5" />
<txp:else />
<h3>All articles:</h3>
<txp:article_custom category="diverse" sort="LastMod desc" limit="3" form="MTS_article_default" />
</txp:if_category>
<p><txp:older><txp:text item="older" /></txp:older>
<txp:newer><txp:text item="newer" /></txp:newer></p>
</txp:if_individual_article>
Offline
Re: Categories: Showing specfic category excerpt list on separate page
Hi Gocom,
Do you mean by “tag trace” any errors shown when page is generated?
If so, then my answer is that there are no errors.
The problem is I’m a txp noob and don’t know how to structure the code to produce the described effect :-(
Let me know if i have understood you correctly.
I think, therefore I AM, … … er … I think :-?
Offline
Re: Categories: Showing specfic category excerpt list on separate page
WoW mary, thx.
I have applied it to the site and produced the desired effect on the default page.
How would I get the generated list on separate page, (ie the archive page where the layout is different)
ps. i know how to trace Gocom.
tag_error <txp:beginning length=“350” format=“inside” linktext=“Lees meer” styleclass=“morelink” cfield=“continue” /> -> Notice: Undefined index: continue on line 19
I think, therefore I AM, … … er … I think :-?
Offline
Re: Categories: Showing specfic category excerpt list on separate page
I have read that if you desire content to be rendered to a different page you need to place between the <txp:if_article_list>.
I want the page to render using my “MTS_archive” page template, but don’t know to achieve this.
I do’nt mind reading up on the subject and sorting it out myself but could do with some good pointers… anybody…
Here is the current code of the page
<txp:if_individual_article> <txp:article limit="1" form="MTS_single" /> <p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev> <txp:link_to_next><txp:next_title /></txp:link_to_next></p> <txp:else /> <txp:if_article_list> <txp:if_category> <h3>Articles in category <txp:category title="1" />:</h3> <txp:article limit="5" /> <txp:else /> <h3>All articles:</h3 <txp:article_custom category="diverse" sort="LastMod desc" limit="3" form="MTS_article_default" /> </txp:if_category> </txp:if_article_list> <p><txp:older><txp:text item="older" /></txp:older> <txp:newer><txp:text item="newer" /></txp:newer></p> </txp:if_individual_article>
Would i have to approach this as a static page making another section and rendering the category article that way?
Last edited by Timid&friendly (2007-08-13 17:17:23)
I think, therefore I AM, … … er … I think :-?
Offline
Re: Categories: Showing specfic category excerpt list on separate page
Two ways:
Surround your code with:
<txp:if_section name="section name">
<!-- Your content here -->
</txp:if_section>
Or at TXP / Presentation / Sections
Set specific archieve-section to use page template named “MTS_archive”.
Cheers!
Last edited by Gocom (2007-08-13 19:14:03)
Offline
Re: Categories: Showing specfic category excerpt list on separate page
I did both but i seem to be missing how you can by clicking on a front page use the section template. Please excuse my ignorance, i’m a designer not a programmmer.
In static sites you define the page you want to go to in the link. I haven’t yet understood how this is done dynamically. That’s why i am not able to use your kind advice correctly.
Don’t give up on me lol
<txp:if_section name="categories">
uses the “MTS_archive” page template that has a single column layout.
Here’s the code:-
<txp:if_section name="categories"> <txp:if_individual_article> <txp:article limit="1" form="MTS_single" /> <p><txp:link_to_prev><txp:prev_title /></txp:link_to_prev> <txp:link_to_next><txp:next_title /></txp:link_to_next></p> <txp:else /> <txp:if_article_list> <txp:if_category> <h3>Articles in category <txp:category title="1" />:</h3> <txp:article limit="5" form="MTS_single" /> <txp:else /> <h3>All articles:</h3> <txp:article_custom category="diverse" sort="LastMod desc" limit="3" form="MTS_article_default" /> </txp:if_category> </txp:if_article_list> <p><txp:older><txp:text item="older" /></txp:older> <txp:newer><txp:text item="newer" /></txp:newer></p> </txp:if_individual_article> </txp:if_section>
I think, therefore I AM, … … er … I think :-?
Offline
Re: Categories: Showing specfic category excerpt list on separate page
I think the problem lies with the automatic category links TXP generates: www.site.com/category/cat-name
. It seems like you tried to work around the problem by creating a section called “categories” – but I’m not sure if that works. – Anyone?
Your nested tags look very complicated and I think at one point you nested them wrongly.
I have done it differently on my site:
<txp:if_category name="material"><h2>Material</h2></txp:if_category>
<txp:if_category name="infoartikel"><h2>Infoartikel</h2</txp:if_category>
// this is for specific category headings
<txp:if_category> // this is generic for *any* category page
<txp:article allowoverride="0" form="articleCategory" listform="articleList" limit="500" pgonly="0" />
<txp:else />
// this is used for the actual homepage, i.e. a page that is *not* a category list
<txp:article allowoverride="0" form="article" listform="articleList" limit="1" pgonly="0" />
</txp:if_category>
I’m not sure I understood your problem correctly but the above setup gives you two simple choices for pages that are category listings and the homepage. You can use the listform
attribute to distinguish between individual articles and article lists.
Last edited by andreas (2007-08-14 19:47:07)
Offline
Re: Categories: Showing specfic category excerpt list on separate page
All the above options keep you using the same page-template and consequently the same layout.
I bought the Textpattern Solutions book (very helpful btw) and after reading have discovered that pointing to sections allows you to use a different page-template and consequently a different layout. What i want.
However the standard output of a category don’t seem to allow you point to a different landing page (section) with it’s corresponding page-template.
Do i have to handcraft some category link format to take me to a different page-template or is there an easier solution.
Or is the solution to hide whole chunks of layout in a complex series of nested if/else tags and find a way of seving the appropriate modified style for the page elements (i hope i don’t have to do this)
Last edited by Timid&friendly (2007-09-02 10:03:28)
I think, therefore I AM, … … er … I think :-?
Offline
#11 2007-09-02 16:50:00
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Categories: Showing specfic category excerpt list on separate page
The article tags as used in the code in previous posts should go on your section page template. The problem will be in the category links used on the front page.
All category tags (<txp:category_list />
, <txp:category />
, <txp:category1 />
and txp:category2 />
) can have the attribute section
. So if you use one or more of these to link to your category pages, and you want the category pages to use a different section/page, use the section
attribute. If you don’t, the front page will be used to display category lists.
Offline
Re: Categories: Showing specfic category excerpt list on separate page
Aha…. Els bedankt, dat werkt!
Very helpful.
Because I am outputting articles attributed to diverse sections i am obligated to use the <txp:article_custom />
tag.
However since i am no-longer using the <txp:article />
tag on the section page-template i am getting this error:-
tag_error -> Textpattern Notice: De modelpagina MTS_default-categorytest heeft nog geen txp:article tag on line 464
Is that a problem, I just don’t need the <txp:article />
but the system suggests otherwise? whats going on and can i ignore this message?
I think, therefore I AM, … … er … I think :-?
Offline