Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-09 05:15:59

timbook2
New Member
Registered: 2008-09-09
Posts: 3

How can I make an horizontal article navigation on top?

Could be answered already, but I just started with Textpattern, have some html/css and CMS skills.

I want to have only my latest article on the frontpage at all time. Nothing else. The user can use previous(title) to browse back in to time. Later the user can use next(title) also.
Something like this: http://neemtumijnietkwalijk.nl/

how do I… do this?

thank you in advance.

Last edited by timbook2 (2008-09-09 05:16:29)

Offline

#2 2008-09-09 09:41:25

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: How can I make an horizontal article navigation on top?

Use <txp:article lmit=“1” /> to return the most recently posted article only, this still leaves all the pagination statistics available (Older/Newer ect when in list mode, Prev/Next when in individual article mode).

Offline

#3 2008-09-09 13:34:08

timbook2
New Member
Registered: 2008-09-09
Posts: 3

Re: How can I make an horizontal article navigation on top?

Ok, so I used <txp:article limit=“1” /> to show my newest article on top. That works.
The next thing is that I tried <txp:link_to_prev><txp:prev_title /></txp:link_to_prev> and <txp:link_to_next><txp:next_title /></txp:link_to_next> in the <!—head—> section but I get an error saying it can’t be used outside its own context.

I also want to remove the stuff at the bottom of the page so you only see the latest article and just two links (next and prev)

Offline

#4 2008-09-09 16:18:22

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: How can I make an horizontal article navigation on top?

On your default or index page your opening article/articles are always in list mode. You need to be in single article mode with an article id defined in the url to allow TXP to calculate the link_to_next and link_to_prev values which are also urls).

Pagination is calculated by the article tag, so any tags that depend on pagination statistics will need to follow an article tag to be considered in context. To use such tags in the head of a page, use a second article tag placed earlier in the template the those tags using the pgonly attribute in the article tag to prohibit article content display. It also helps to prevent confusion if the limit and offset attributes match between the two article tags.

Textbook definition: article tag

Offline

#5 2008-09-10 00:47:26

timbook2
New Member
Registered: 2008-09-09
Posts: 3

Re: How can I make an horizontal article navigation on top?

After some time trying out different stuff with your clues it came out jsut the way I want it.
The result: http://www.timkallenbach.nl

thank you!

bye.

Offline

Board footer

Powered by FluxBB