Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-20 00:51:03

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Archive in Article section? (/articles/archive/)

How do I achieve an archive page within the articles section? So that the url reads /articles/archive/ instead of just /archive/. (This is mainly for good looks as I renamed my articles section to weblog and after all the archive is part of the weblog.)

Offline

#2 2009-01-20 07:32:11

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

Re: Archive in Article section? (/articles/archive/)

Have a look at gbp_permanent_links. You could use it to insert a text snippet ‘archive’ in the URL, or (using a category ‘archive’), create /section/category/title URLs. There is no native Txp way to achieve this.

Offline

#3 2009-01-20 07:39:04

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Archive in Article section? (/articles/archive/)

You can also just use an article titled “archive” in the articles section, and either use output_form to pull in your archive, or place the archive manually into the article.

Offline

#4 2009-01-20 12:41:36

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: Archive in Article section? (/articles/archive/)

I think I’ll try the article named “archive” together with a custom form. Should work.

Offline

#5 2009-01-20 13:45:42

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Archive in Article section? (/articles/archive/)

Yes, think I’ll write a TXP Tip on this method of archive…not tried this before but it should work fine. If you have any code to share, please post it!

Offline

#6 2009-01-20 13:47:36

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: Archive in Article section? (/articles/archive/)

Will do, just give me a day or two.

Offline

#7 2009-01-20 20:17:17

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

Re: Archive in Article section? (/articles/archive/)

Ah, so simple, why didn’t I think of that… (doh, I’m even using this method myself…)

jstubbs wrote:

Yes, think I’ll write a TXP Tip on this method of archive…not tried this before but it should work fine. If you have any code to share, please post it!

I think the code can be copied for the most part from this TXP Tip :)

Offline

#8 2009-01-20 20:36:17

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Archive in Article section? (/articles/archive/)

Els, I post TXP Tips, but I don’t necessarily read them :-) I was thinking of something more simple actually. Lets see what dl33 comes up with first!

Offline

#9 2009-01-21 18:19:34

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

Re: Archive in Article section? (/articles/archive/)

jstubbs wrote:

I post TXP Tips, but I don’t necessarily read them :-)

Caught! :) (If I were you I wouldn’t have mentioned that…)

Here is a very basic example (I’m using it for a sitemap page):

<ul>
	<li><txp:link_to_home>Home</txp:link_to_home></li>
	<txp:section_list sections="section-5,section-1,section-2,section-7" break="">
		<li><txp:section title="1" />
			<txp:article_custom section='<txp:section />'>
				<txp:if_first_article><ul></txp:if_first_article>
					<li><a href="<txp:permlink />" title="<txp:title />"><txp:title /></a></li>
				<txp:if_last_article></ul></txp:if_last_article>
			</txp:article_custom>
		</li>
	</txp:section_list>
</ul>

(Don’t forget the break="" in section_list or it will output <br />s.)
You can of course add a link="1" to <txp:section />.

Last edited by els (2009-01-21 18:22:16)

Offline

#10 2009-01-21 19:04:25

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Archive in Article section? (/articles/archive/)

Yeah, I shouldn’t admit to not reading..well, I did mean not thoroughly! I spend more time putting the tips together for easy reading for users than anything else…

Your code – are you placing that in an article like we talked earlier in the thread?

Offline

#11 2009-01-21 20:03:03

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

Re: Archive in Article section? (/articles/archive/)

Yes, that’s in an article. In my case the URL is /information/sitemap, but it can just as wel be /articles/archive.

Offline

#12 2009-01-21 20:18:59

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Archive in Article section? (/articles/archive/)

Mind if I use this for a TXP Tip? (And I’ll read it very carefully first!) :-)

Offline

Board footer

Powered by FluxBB