Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Related articles by posted date
Hey!
I will love to know please how can I create a related articles list of the same date as the current article that being view please?
I can do this:
<txp:article_custom month='<txp:posted format="%Y-%m-%d" />' section="audio" />
But it will also include the current article in it.
So is there any trick to offset the current article from the custom list?
(by using the article-id somehow?)
Offline
#2 2010-01-27 22:53:10
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Related articles by posted date
In your article form:
<txp:if_individual_article>
<txp:if_article_id>
<txp:else />
// here your article content
</txp:if_article_id>
</txp:if_individual_article>
Not sure if the if_individual_article tags are needed here. If you already have them somewhere on the page, wrapped around this article_custom tag, you don’t need them in the form.
Offline
#3 2010-01-27 22:55:20
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Related articles by posted date
On second thought, I don’t think the if_individual_article tag works in an article custom form; they need to be outside the article custom tag if I remember correctly.
Offline
Re: Related articles by posted date
Cool! thanks works great!
and yea no need for if_individual_article tag
(If you already using all of this into a form that is only for individuel article)
So we got this:
<txp:article_custom month='<txp:posted format="%Y-%m-%d" />' section="my-section-name">
<txp:if_article_id>
<txp:else />
// here your article content
</txp:if_article_id>
</txp:article_custom>
=)
And btw:
If I want to use a form:
<txp:article_custom month='<txp:posted format="%Y-%m-%d" />' section="my-section-name">
<txp:if_article_id>
<txp:else />
<txp:output_form form="my-form-name" />
</txp:if_article_id>
</txp:article_custom>
Last edited by THE BLUE DRAGON (2010-01-28 00:15:55)
Offline
Pages: 1