Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Selecting a

#1 2005-10-04 02:32:37

BenWard
New Member
From: Manchester
Registered: 2005-10-04
Posts: 2
Website

Selecting a

OK, this is perhaps a touch complex and hackish for my first query, but I’m trying to port an existing site over to TextPattern so I need to try and make this work. All help is hugely appreciated.

On my front page, I have an article list for a section named ‘News’. I also have sticky items in the ‘News’ section at the top of the same list.

Also on the front page I have a single piece of content which, in the semantics of TextPattern, is from a different section (‘Gigs’). I only want one single article from it, and it makes most sense for that article to be identified by ‘Sticky’ status.

The non-TxP version of the site is http://resintheband.com. Mapping its content to TextPattern: The news items are in the main front-page section (‘News’), the ‘Welcome to…’ article is also in ‘News’, but is marked as Sticky. In my TxP porting, this part works fine.
Now, at the top is the ‘Next Gig’ ticket, and it’s this content that would come from the separate ‘Gigs’ section. I’d like for the site owner to be able to enter as many upcoming gigs as he likes into this ‘Gigs’ section, but to manually indicate the article to display by marking one single article in the ‘Gigs’ section as ‘Sticky’.

…And breathe.
I really hope that makes some kind of sense.

I’ve read up on techniques for including specific article content, but that seems reliant of having one specific article targeted and calling it in using the ID number. This is more a case of specifying a specific section and sticky status and returning a single non-specific article.

Thanks very, very much for your help. I’m new to TextPattern and having spent quite a while finding the XML templating rather ‘weird’, I am starting to get to grips with it.

Offline

#2 2005-10-04 05:21:23

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

Re: Selecting a

I believe you could use <code><txp:article_custom status=“sticky” section=“SectionName” /></code> however I’m a little doubtful about whether you can have 2 stickies on the same page so how about <code><txp:article_custom id=“123” /></code> instead.

Last edited by thebombsite (2005-10-04 05:21:46)


Stuart

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

Offline

#3 2005-10-04 12:40:33

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

Re: Selecting a

I’m a little doubtful about whether you can have 2 stickies on the same page

You can, they’re just regular articles with a different status (5 instead of 4).


Alex

Offline

#4 2005-10-04 14:37:06

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

Re: Selecting a

Thanks for the info zem. I don’t know why I was thinking that. I can’t find any reference to it. Maybe it’s because I thought it only worked with the <code><txp:article /></code> tag. :(


Stuart

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

Offline

#5 2005-10-04 15:55:42

BenWard
New Member
From: Manchester
Registered: 2005-10-04
Posts: 2
Website

Re: Selecting a

Thank you very very much, especially ‘thebombsite’ as you code worked exactly as desired.

Offline

#6 2005-10-04 20:09:32

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

Re: Selecting a

You’re welcome. :)


Stuart

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

Offline

  1. Index
  2. » Archives
  3. » Selecting a

Board footer

Powered by FluxBB