Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [howto] Make a category listing use the same section and template
Thanks for your enlightenment on this matter, Stuart.
I also prefer to use the inbuilt tags rather than a plugin… every time that’s possible.
Offline
#14 2006-03-18 01:17:31
- Ji31
- Member
- Registered: 2005-08-24
- Posts: 103
Re: [howto] Make a category listing use the same section and template
If I make it – I get just the one article of which link was clicked!
Why?
Offline
Re: [howto] Make a category listing use the same section and template
I’m sorry, I didn’t understand that. A bit more information required methinks. ;)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#16 2006-03-28 22:55:52
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [howto] Make a category listing use the same section and template
Nice tip, Stuart. Just one thing, for the link’s text, you’ll want the category’s title, rather than its name. I think you just forgot about that when you posted the code here. :)
<a href="<txp:site_url /><txp:section />/?c=<txp:category1 />"><txp:category1 title=1 /></a>
Offline
Re: [howto] Make a category listing use the same section and template
Well wash my mouth out with soap! Slight slip of the keyboard there Mary. Thanks for pointing it out. I’ve altered my original post. I should mention whilst I’m here that using this method will produce a category listing that is also “section-sensitive”.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: [howto] Make a category listing use the same section and template
Yeah, Stuart, good tip. I dont usually work with categories (it’s hard to me to make my head around the category concept…), but this tip is very helpful.
thebombsite wrote:
I should mention whilst I’m here that using this method will produce a category listing that is also “section-sensitive”.
How will you do that, Stuart?
I’m trying to think a way to replace the txp:category_list
tag for the frontpage. It doesnt care if it doesnt work “automatically”. I mean, I trying to achieve a category list… hardcoded…
My first approach will be this:
<code>
<ul>
<li><a href=”<txp:section name=“journal” />/?c=<txp:category name=“software” />”><txp:category name=“software” title=1 /></a></li>
<li><a href=”<txp:section name=“journal” />/?c=<txp:category name=“humor” />”><txp:category name=“humor” title=1 /></a></li>
<li><a href=”<txp:section name=“journal” />/?c=<txp:category name=“textpattern” />”><txp:category name=“textpattern” title=1 /></a></li>
…
</ul>
</code>
Do you think something like that will work?
Also, I have discovered few minutes ago that <txp:category /> supports a section="section name text"
attribute :|
So, could the snippet above be replaced by the following?
<code>
<ul>
<li><txp:category name=“software” link=1 title=1 section=“journal” /></li>
<li><txp:category name=“humor” link=1 title=1 section=“journal” /></li>
<li><txp:category name=“textpattern” link=1 title=1 section=“journal” /></li>
…
</ul>
</code>
What do you think?
Thanks in advance, god of tag combination (me… just a king)
Last edited by maniqui (2006-04-27 03:47:20)
Offline
Re: [howto] Make a category listing use the same section and template
Well if I’m not mistaken maniqui, the resulting list will be section-sensitive because the article tag is section-sensitive, assuming that’s what you are using in your page template.
I’ll have to take a closer look at your code but you could use the “if_different” method that I suggested above and specify the section in the article_custom tag if your method doesn’t produce the correct results. Might be less coding too.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#20 2006-04-09 17:07:36
- popstalin
- New Member
- Registered: 2006-04-09
- Posts: 4
Re: [howto] Make a category listing use the same section and template
I’m wanting to achieve this with my category_list tag. I have a static index page, which will remain so, therefore, I’d like my category links to be by section (since they aren’t on the index page). Can anyone help?
I’ve tried different methods with the code given in the first post but can’t manage to get it to work correctly.
If you take a <a href=“http://www.popstalin.com/blog/ “>look here</a>, you’ll see what I mean.
(Index page for blog where there are categories and my sections will reside here as well)
Here is the <a href=“http://www.popstalin.com/”>static front page</a>
UPDATE:
I just found the <a href=“http://textpattern.org/plugins/470/”>cbs_category_list</a> plugin that does exactly what I’m looking for.
Last edited by popstalin (2006-04-15 20:34:46)
Offline
#21 2006-07-24 08:31:58
- PeterH
- Member
- Registered: 2006-07-23
- Posts: 10
Re: [howto] Make a category listing use the same section and template
Sorry to bring back an old thread, but can you do the same thing with clean URLs?
I tryed <code><a href=”<txp:site_url /><txp:section />/category/<txp:category1 />”><txp:category1 title=1 /></a></code>
But it just returned what you would usually see on: <code><txp:site_url />/<txp:section /></code>
Last edited by PeterH (2006-07-24 08:34:36)
Offline
#22 2006-07-24 14:51:45
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [howto] Make a category listing use the same section and template
Sorry to bring back an old thread, but can you do the same thing with clean URLs?
No.
Offline
#23 2006-09-04 15:10:45
- edmungo
- Member
- Registered: 2006-07-10
- Posts: 12
Re: [howto] Make a category listing use the same section and template
I couldn’t get the code above to work at all, so after some fiddling around I’ve found an alternative that does work for the (standard) setup I have:
<code>
<a href=”<txp:site_url />index.php?s=<txp:section />&c=<txp:category1 />”><txp:category1 title=1 /></a>
</code>
Last edited by edmungo (2006-09-04 15:29:10)
Offline