Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-10-04 01:31:52
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Trying to understand <article> tag from textbook better...
I was looking through the tags at textbook and was looking at the <txp:article />
tag found <a href=“http://textpattern.net/wiki/index.php?title=Txp:article_/”>HERE</a> and I’m not sure what these example would do and why you would want to use them:
<code>
<div id=“first”><txp:article limit=“1” pageby=“10” /></div>
<div id=“middle”><txp:article limit=“8” offset=“1” pageby=“10” /></div>
<div id=“last”><txp:article limit=“1” offset=“9” pageby=“10” /></div>
</code>
<br />
<code>
<txp:article limit=“5” pageby=“10” />
<!— google ad —>
<txp:article limit=“5” offset=“5” pageby=“10” />
</code>
<br />
The first code snippet I’m really confused on. I have no idea what it’s saying there.
<br />
As for the second snippet, if I understand it correctly, it’s just showing you how you can place a google ad code inbetween a list of excerpts/articles with 5 articles before the google ad and 5 after it, right?
Thanks
Last edited by deronsizemore (2006-10-04 01:32:11)
Offline
#2 2006-10-04 04:12:42
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Re: Trying to understand <article> tag from textbook better...
What this was introduced for is to be able to split up chunks of article listings and be able to browse back and forth without any side-effects.
It is used for article list landing pages, where you can either split up the listings on different pages, or equally split them up symmetrically in different pages.
The offset attribute counts from the last article downwards if last article is first and uses that as first output.
The pageby attribute tells TXP the total number of articles for paging on each page, well and the limit attribute limits the output number of articles per tag.
So if you wanted pages with 4 articles per page in two chunks with two articles each, then you would do pageby=4 and limit=2
for both tags, and offset=2 for the second tag .
However, the new syntax has now a new attribute, that unifies all that into one and accepts all that as a comma seperated list.
(v4.0.4 only) Search the FAQ for details, if you get confused.
regards, marios
Last edited by marios (2006-10-04 04:16:25)
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#3 2006-10-04 13:04:21
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: Trying to understand <article> tag from textbook better...
Ah, I think I see what you’re saying. I guess I’m just not real advanced with txp. Like for my site when I write articles, I’ve got excerpts that show up on the homepage of the site, and I just use the limit=5 (or whatever number) attribute to limit the amount of excerpts shown on the homepage. I’ve never used the pageby before, but see why it’s there now.
Thanks marios.
Offline