Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-17 13:49:38

Buddy Bradley
Member
From: Peterborough, UK
Registered: 2004-07-01
Posts: 12
Website

Introduction, lists of articles and individual articles on one page?

It’s very easy to set up a page to show both a list of articles, or an individual article, dependent on context using the txp:if_individual_article and/or txp:if_article_list tags.

But – what I want to do is be able to hit my page in three different ways:

/mypage

would just display a static introduction to the section

/mypage/category

would show a list of all the articles in that category, as if I’d matched txp:if_article_list.

/mypage/123/article-title

would just show that single article, with comment form as normal.

I can do just 2 and 3, but can’t work out how to suppress all articles and just show the static content if no parameters (article id or category name) are passed in the URL.

Last edited by Buddy Bradley (2005-10-17 13:54:02)

Offline

#2 2005-10-17 16:38:47

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Introduction, lists of articles and individual articles on one page?

Would glx_if_section_frontpage do it?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2005-10-17 18:24:31

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

Re: Introduction, lists of articles and individual articles on one page?

Offline

#4 2005-10-17 18:34:29

Buddy Bradley
Member
From: Peterborough, UK
Registered: 2004-07-01
Posts: 12
Website

Re: Introduction, lists of articles and individual articles on one page?

That’s done it, thanks mary. :) I didn’t think you could nest conditional tags.

Only thing I can’t seem to do is get clean URLs to work with it – because I’m on a particular page/section, my URL is:

www.mysite.com/section-name/

so ideally I would like to navigate to categories within that section like this:

www.mysite.com/section-name/category-name

or even:

www.mysite.com/section-name/category/category-name

The only way I can get it to work properly at the moment is by linking to:

www.mysite.com/section-name/?c=category-name

Everything else just returns a 404. Muchos gracias. :)

Last edited by Buddy Bradley (2005-10-17 18:38:12)

Offline

#5 2005-10-18 22:36:02

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Introduction, lists of articles and individual articles on one page?

The only way I can get it to work properly at the moment is by linking to:
www.mysite.com/section-name/?c=category-name
Everything else just returns a 404.

That’s because this last URL is the correct one. Textpattern doesn’t support /section/category URLs.


Alex

Offline

Board footer

Powered by FluxBB