Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-14 11:39:35

chucky
New Member
Registered: 2007-05-14
Posts: 2

Help me understand the default template functioning

hi !
i am a textpattern beginner :), i read the documentation but i don’t precisely understand how the default template works ( the one installed together with textpattern ) :

there is an “article” section, with one article in it ( First post : lorem ipsum dolor … ), if i understood, this section homepage ( example.com/article and all its articles example.com/article/First Post ) share the same template ( the “default” under the pages tab in the admin )

in this default page, there is this tag :

<txp:article limit=“5” />

When i visit the “example.com/article” url, 5 articles are displayed

but when i click on one of the links on that page, ( i’m then in the example.com/article/1/First Post ), the <txp:article limit=“5”> only list the “First Post” article

how does that tag know it isn’t on a section root page, and that it only has, through the <txp:article limit=“5”> to display one article ???

thanks

Offline

#2 2007-05-14 12:50:21

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: Help me understand the default template functioning

Look at the Textbook you find the tag list here
then check txp:article to see how it work

Basically txp:artcile is context sensitive, when you point example.com/article it guves you a list of articles in section article (the 5 because you make “limit=“5”), but when you click on one of them (example.com/article/1/First Post) it sows you an individual article using page “article”.

At the beginning understunding txp is not easy but when it become all things become clear!

Offline

#3 2007-05-14 14:09:25

chucky
New Member
Registered: 2007-05-14
Posts: 2

Re: Help me understand the default template functioning

thank you

Offline

#4 2007-05-14 14:20:33

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: Help me understand the default template functioning

Two long-ish articles by Destry may help you get your head round txp’s page make-up:

  1. Understanding textpattern building blocks
  2. TXP building block mechanics

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB