Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Archive pages
I’m converting an existing (hardcoded) website to Textpattern. At the moment I’m working on a test server until work is completed.
To create archive pages I followed the instructions of the Textbook, but encounter a bit of a problem there. My client has got “daily messages” to post on the website (http://d306.mysite.westnethosting.com.au/daily-messages/). I created three articles with three different dates (24th-26th Sep).
My page code:
<code>
<h4>Daily messages</h4>
<!— Link to form “static_text_daily”. —>
<txp:article limit=“1” form=“static_text_daily” />
<br />
<h3>Older messages</h3>
<dl>
<!— Link to form “daily_message_past”. —>
<txp:article limit=“20” offset=“1” form=“daily_message_past” />
</dl>
</code>
<code>
The form for past messages:
<dt><p><a href=”<txp:permlink />” title=”<txp:title />”>Posted on <txp:title /></a></p></dt>
</code>
I have one section called daily-messages and when I first go the the page it is ok. It shows the latest entry in full and two older messages at the bottom. But, as soon as I’m clicking one of the older messages it displays the older message, but only a link to the displayed message at the bottom of the page. The other older messages are not shown.
Any ideas what I’m doing wrong?
Many thanks
otti
Offline
#2 2008-09-27 08:49:34
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Archive pages
That’s because <txp:article />
is context sensitive, and therefore, on an individual article page, it will display nothing but that particular individual article. If you still want to display older articles on the individual article page, you’d have to use <txp:article_custom />
and <txp:if_individual_article>
.
Though you wouldn’t be able to use offset="1"
because that would display the same list on every individual article page. An alternative for individual article pages would be not to display a list of older articles, but use <txp:link_to_prev>
which would link to the previous article.
Offline
Re: Archive pages
Hi Els,
Thanks for your reply. I tried your sugestions, but this is still not what I want. Do I have to use an archive plugin? My client wants to write new articles daily, and we would like to have older ones (up to a certain amount) displayed at the bottom as links. Once a new artcile is written, the previous one should move into older messages. If I have to use a plugin, do I have to create a new section every time I create a new article?
Some help in the right direction would be very much appreciated.
Cheers
otti
Offline
#4 2008-09-29 15:42:59
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Archive pages
Let me check if I understand this correctly: even if an individual article posted in the past (let’s say a year ago) is displayed, it has to be followed by a list of articles older than that?
Offline
Re: Archive pages
Hi Els,
Ok, My client writes daily messages using a new article each day (assigned to the same section: daily-messages). We would like to display the current daily message messages page. Below that should be a list of older messages, i.e. the last month. Each of those older messages should be a link to that particular older message. Once a user clicks to an older message it should disply and again the last month shopuld be at the bottom of the page as older messages.
Once a month is full, my client would like to have a link to an extensive list of all existing messages (sorted by date).
Does that make more sense?
Thanks again very much
otti
Offline
#6 2008-09-30 20:00:30
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Archive pages
I’m sorry Otti, I don’t seem to be very smart these days… So before I give you a piece of completely useless code, some more questions:
otti wrote:
My client writes daily messages using a new article each day (assigned to the same section: daily-messages). We would like to display the current daily message messages page. Below that should be a list of older messages, i.e. the last month. Each of those older messages should be a link to that particular older message.
So like this?
Top: full current daily message (today)
Bottom: list of permlinks to messages from yesterday back to the 1st of the month
Once a user clicks to an older message it should disply and again the last month shopuld be at the bottom of the page as older messages.
Like this?
Top: full message (e.g. 20th of the month)
Bottom: list of permlinks to messages from 19th back to 1st of that month
Once a month is full, my client would like to have a link to an extensive list of all existing messages (sorted by date).
Do you mean on a month’s last day’s article page? So that page wouldn’t have a list of links to all previous messages in that month, but to all messages?
Or should this list be on every article page that is not in the current month?
I’m really sorry that I still don’t quite get it…
Offline
Re: Archive pages
Thanks Els for all your effort in trying to understand what I want. I found a solution in the meantime and it works out quite well. My page template has got two forms.
The first one links to the current message.
The second one links to the monthly daily message.
I also have a link to an extra archive page where I limit to the last 30 days of messages.
Have a look at
http://d306.mysite.westnethosting.com.au/daily-messages/
My client seems to be quite happy with that, so I’m happy too.
Let me know if you have got any suggestions or if you agrre with what I’ve done.
Cheers
otti
Offline
Pages: 1