Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-12-12 17:29:09

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

archiving older posts and starting fresh

what would be a good workflow for cleaning up my site a little?

i want to take all my existing posts, and maintain them in an archive (i know how to build this page).

so the next step, is i’m guessing there needs to be some kind of conditional set up to say “if article id is equal to or less than…”, and once it reaches this point it will say there are no more posts and send them over to the archive page. can anyone point me in the direction for doing this?

now another option that i am considering, is wrapping the site up into a subfolder, and doing 301 redirects. then i will really have a clean slate to work with. i dont necessarily want to take it that far yet.

Offline

#2 2011-12-12 18:06:04

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: archiving older posts and starting fresh

A simple solution would be to use <txp:older />:

<txp:variable name="olderarticles" value='<txp:older />' />
<txp:if_variable name="olderarticles" value="">
   link to your archive page
<txp:else />
   <txp:older />
</txp:if_variable>

You can do the same with <txp:prev /> for the individual article mode.

Offline

#3 2011-12-12 19:33:22

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: archiving older posts and starting fresh

that’s great. thank you!

Offline

#4 2011-12-12 20:13:49

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: archiving older posts and starting fresh

Els, I don’t understand the solution. It seems like the older tag would always return output if the archived articles were in the same section. Doe this solution resume that the archived articles have been switched to another section, or am I missing something?

Offline

#5 2011-12-12 22:48:16

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: archiving older posts and starting fresh

John, yes, my suggestion is based on the assumption that the archived articles are in a separate section. Elliott, is that what you meant to do?

Last edited by els (2011-12-12 22:48:58)

Offline

#6 2011-12-12 22:57:29

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: archiving older posts and starting fresh

Els’ solution: I don’t get it yet.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2011-12-12 23:02:36

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: archiving older posts and starting fresh

maniqui wrote:

Els’ solution: I don’t get it yet.

If there are no older articles in a section, <txp:older /> won’t display anything, right? But if two very experienced Txp users are not ‘getting’ it, chances are that I am overlooking something ;) Just tell me if I am!

Offline

#8 2011-12-12 23:07:28

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: archiving older posts and starting fresh

Ah, ok, now I get it.

This snippet is to be used in some section (not the other one where the articles has been archived) and will be “triggered” after reaching the last page (on article list context) of articles for this new section. At that point, it will show a link to the other section.

Right?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2011-12-12 23:11:52

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: archiving older posts and starting fresh

maniqui wrote:

Right?

Right :)

Offline

#10 2011-12-12 23:14:43

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: archiving older posts and starting fresh

I got it after you confirmed that the archived articles were cordoned off in their own section. I didn’t gather that from the original post, but it makes perfect sense!

Offline

#11 2011-12-12 23:23:22

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: archiving older posts and starting fresh

johnstephens wrote:

I didn’t gather that from the original post

It doesn’t say so, I just jumped to conclusions ;) So my ‘solution’ may be useless, if Elliott didn’t mean it that way.

Offline

#12 2011-12-13 01:31:28

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: archiving older posts and starting fresh

I think Els understood my original question. The only problem is I haven’t tried it yet, but it seems to fit the bill for what I’m doing. I will report back

Offline

Board footer

Powered by FluxBB