Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-11-14 00:51:49
- apo
- Member
- From: Germany
- Registered: 2004-10-27
- Posts: 53
HTML code after x articles
hi there,
is there a way to give some output after a chosen number of articles, just between two articles in the article list?
the scenario: i would like to put a banner after the first or second article in my front page article list.
Offline
Re: HTML code after x articles
How about:
<code><txp:article limit=“2” />
<!— banner code goes here —>
<txp:article offset=“2” limit=“3” /></code>
Assuming that you want to display 5 articles, and your banner after the second one.
Offline
#3 2005-11-14 01:01:19
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: HTML code after x articles
You’d take a plugin like zem_nth (make sure to read the help doc for it, there are lots of ways to use it) and adjust your article form.
Offline
Re: HTML code after x articles
In 4.0.2 there is a new “pageby” attribute for article tags which should allow you to do this without messing up your paging. And now I need to find out where the explanation is. I’ll be back.
Here it is. I think you will find that Elenita’s suggestion messes up your paging and why use a plug-in?
Last edited by thebombsite (2005-11-14 01:07:54)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: HTML code after x articles
<blockquote>I think you will find that Elenita’s suggestion messes up your paging and why use a plug-in?</blockquote>
Damn it, I knew that was too easy. Thanks for the heads-up on the “pageby” attribute, Stuart.
Offline
Re: HTML code after x articles
No problem. Oddly I tried something like this myself before we had “pageby” and now we have it I haven’t bothered. Typical or what?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#7 2005-11-14 02:50:40
- apo
- Member
- From: Germany
- Registered: 2004-10-27
- Posts: 53
Re: HTML code after x articles
ah thanx… it seems to work nicely :-) -> http://www.mfkne.de
just a try, will do it better tomorrow, but now its already too late for me.
btw: it seems that also works when mixing around with the tags:
<code>
<txp:output_form form=“header” />
<txp:article form=“default” listform=“excerpt” limit=“1” pageby=“10” />
<txp:if_article_list>
<p style=“text-align:center;”><img src=”/images/banners/COPY_banner.jpg”></p>
</txp:if_article_list>
<txp:article form=“default” listform=“excerpt” limit=“9” pageby=“10” offset=“1” />
<txp:if_individual_article>
<ul class=“postfoot”>
<li class=“icon prev”><txp:link_to_prev><txp:prev_title /></txp:link_to_prev></li>
<li class=“icon next”><txp:link_to_next><txp:next_title /></txp:link_to_next></li>
</ul>
</txp:if_individual_article>
<txp:if_article_list>
<p>
<txp:older>ältere Artikel</txp:older>
<txp:newer>neuere Artikel</txp:newer>
</p>
</txp:if_article_list>
<txp:output_form form=“sidebar” />
<txp:output_form form=“footer” />
</code>
Offline
Pages: 1