Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-06 16:22:57

dimfish
Member
Registered: 2006-06-01
Posts: 72

Link back to category list?

This is I’m sure very easy but….

How do I link back to the list of all articles in a category from an article in that category, and how do I only show this ‘back’ link when there is more that one article in that category.

See what I mean here

So when you choose ‘Introduction’ I’d like a link back from there to the list of articles in ‘What are we doing’.

(the sidebar is a list of categories}.

Thanks : )

Offline

#2 2006-08-06 16:58:52

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Link back to category list?

How do I link back to the list of all articles in a category from an article in that category…

Add to your article form:

<p><a href="<txp:site_url />/<txp:section />?<txp:category1 />">Back to <txp:category1 title="1" /></a></p>

…and how do I only show this ‘back’ link when there is more that one article in that category.

You can’t, at least not without several lines of PHP.

Last edited by Mary (2006-09-03 03:57:46)

Offline

#3 2006-08-06 19:51:54

dimfish
Member
Registered: 2006-06-01
Posts: 72

Re: Link back to category list?

Thanks Mary. Not sure that really helps me as I don’t want every article to have a link to it’s category. I really want to just use it like a back link that will jump back to the previous list of articles (when there is one).

What would I put into the top of an article if I want to hardcode a link back to the category page?

Offline

#4 2006-08-06 21:48:38

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Link back to category list?

What I’ve entered above. You could partly “automate” it by placing it into it’s own form, then just calling the form from your article:

<txp:output_form form="back_to_category" />

or something there abouts.

Offline

#5 2006-09-02 23:07:03

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 700
Website Mastodon

Re: Link back to category list?

Mary wrote:

Add to your article form:

<p><a href="<txp:site_url />/<txp:article_section />?<txp:category1 />">Back to <txp:category1 title="1" /></a></p>

was that mentioned?
i found that the article_section tag doesn’ exist (maybe yet?)
so i used
<code>
<a href=”<txp:site_url /><txp:section />?<txp:category1 />”><txp:category1 title=“1” /></a>
</code>

instead, and it works 8)

Last edited by jayrope (2006-09-02 23:07:33)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#6 2006-09-03 03:57:33

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Link back to category list?

Ah shoot. Yeah that’s in svn, not 4.0.3. Sorry. I’ll correct my code above for anyone else that comes along. Thanks.

Offline

Board footer

Powered by FluxBB