Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Special Style for most recent article
Okay, I guess since I’ve rebooted I can tell you the URL and my problem.
The site is erraticwisdom.com and if you go there you’ll probably see the problem. The way I’m doing it now is by posting the most recent article to a new section, but I just upgraded to version 4.02 and would like to know how to solve this problem with the new tag <txp: if first
Offline
Re: Special Style for most recent article
Sorry, let me explain the problem a little better…
This is a boiled down version of what I have know:
<code>
<div id=“latest”><txp:article_custom limit=“1” section=“latest” /></div>
<div id=“left”><txp:article_custom limit=“1” section=“philosophy” /></div>
<div id=“right”><txp:article_custom limit=“1” section=“life” /></div>
</code>
What I would like to do would be to simply output the two sections and have the most recent article (from either section) displayed within the special division.
Any tips – perhaps involving the new <txp: if_first tag?
Last edited by thame (2005-11-02 22:22:47)
Offline
#15 2005-11-03 00:31:47
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Special Style for most recent article
There are two new features in 4.0.2 you could use. One is the new pageby attribute. The other is the <txp:if_first_article>
tag.
Alex
Offline
Re: Special Style for most recent article
It’s easy for you TXP geniuses to throw out a tag, but help out a moron here :)
Throw me a frickin’ bone here
Last edited by thame (2005-11-03 05:39:04)
Offline
Re: Special Style for most recent article
Thame I’m just guessing here. I haven’t downloaded .02 yet, but I would try:
<code><txp:if_first_article><div class=“newest-article-style><txp:article_custom limit=“1” section=“latest” /></div></txp:if_first_article></code><br/> <code><txp:if_first_article><div class=“newest-article-style><txp:article_custom limit=“1” section=“philosophy” /></div></txp:if_first_article></code><br/> <code><txp:if_first_article><div class=“newest-article-style><txp:article_custom limit=“1” section=“life” /></div></txp:if_first_article></code><br/>Jamie
EDIT:
Looks like some of the newer tags are formed differently:
old: <code><txp:article><txp:article /></code><br/>
new: <code><txp:if_first_article></txp:if_first_article></code><br/>
Last edited by soulship (2005-11-03 15:35:43)
Offline
Re: Special Style for most recent article
> soulship wrote:
> Thame I’m just guessing here. I haven’t downloaded .02 yet, but I would try:
<code><txp:if_first_article><div class=“newest-article-style><txp:article_custom limit=“1” section=“latest” /></div></txp:if_first_article></code><br/> <code><txp:if_first_article><div class=“newest-article-style><txp:article_custom limit=“1” section=“philosophy” /></div></txp:if_first_article></code><br/> <code><txp:if_first_article><div class=“newest-article-style><txp:article_custom limit=“1” section=“life” /></div></txp:if_first_article></code><br/>That would work, but the point was to eliminate the need for the “latest” section and have whichever article was most recent in either section (philosophy or life) placed within a special division.
Last edited by thame (2005-11-03 21:15:04)
Offline
#19 2005-11-04 00:28:50
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Special Style for most recent article
<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>
if_first_article is designed for use inside an article form, I don’t think those article_custom examples make any sense.
Alex
Offline
Re: Special Style for most recent article
zem wrote:
<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>
if_first_article is designed for use inside an article form, I don’t think those article_custom examples make any sense.
No, it’s pretty hard trying to explain what I want..
This is my site right now. As you can see, the content is divided into two sections with the most recent article (from either section) being displayed at the top in a special division.
The way I’m doing it now is by manually posting the most recent article to a new section “latest”. I would like to do (for feed, navigation issues) is post the content directly into it’s proper section and have the most recent article displayed within the special division.
I’m afraid “offset” will not work because the most recent article can come from either section. I was hoping this issue would be solved with one of the new tags but I haven’t been able to figure it out yet.
Last edited by thame (2005-11-04 03:14:19)
Offline
#21 2005-11-04 03:42:14
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Special Style for most recent article
Sounds like a custom job to me.
Alex
Offline
Re: Special Style for most recent article
zem wrote: Sounds like a custom job to me.
i.e. impossible??? :)
Offline