Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-30 10:54:00

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

Understanding how Frontpage works WITH archive template

QUESTION
How can i force txp to use the archive page to display individual_articles from other sections than the front page?

BACKGROUND TO QUESTION:-
Intially I only used txp for the blog on my site. Now I am transferring the whole site into txp.

BEFORE:-
The blog of the site used to be the frontpage and when I clicked on an article it would send me to view the individual_article USING the Archive template. (GREAT!)

NOW:-
The blog is no-longer on the front page and is a section. When i now click Individual_article I am no-longer sent to the archive page to view the clicked article, I remain using the weblog template. (This is a problem because I want a different layout for Individual_articles.

I’m struggling to understand difference between:-
1. How the frontpage works with the archive
2. How other sections work with the archive page


I think, therefore I AM, … … er … I think :-?

Offline

#2 2008-03-30 11:32:41

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Understanding how Frontpage works WITH archive template

You need to associate your blog section to a page template (in ‘section’ tab). You can use the default ‘archive’ page template or you can create another one and make any modification you want to individual article or archive list display. Page template control both archive list and individual article for that section.

You can create how many page template you need, and associate them to you section. So you can always full control the display.

Frontpage use the ‘default’ template, not ‘archive’. Other section can use any template you want. So it’s up to you put in the page template the txp tags that display anything as you like.

Hope this help.

Offline

#3 2008-03-30 11:50:08

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

Re: Understanding how Frontpage works WITH archive template

Thx for your feedback!

The real issue for me is that I want a different template used when viewing individual_articles of the blog section.

The blog section uses a 2 column layout.
The archive section uses 1 column layout

What makes the frontpage = “default section” suddenly use the archive section to display individual_articles? And how can i make the “other sections and specifically the blog section” do the same?

I realise i can split the code in the blog section to render two different page layouts, but since the archive section already uses the template layout I require (and used to do so when it was the default frontpage) I thought it might be possible and easier to make the blog behave as it used to and use the archive template to output individual_articles.

Last edited by Timid&friendly (2008-03-30 11:51:09)


I think, therefore I AM, … … er … I think :-?

Offline

#4 2008-03-30 12:26:16

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Understanding how Frontpage works WITH archive template

You could post those bloggings to the archive section that you have included in the frontpage from the backend’s Sections-tab. Then they would appear on the so called frontpage, but would open in the archive. For the styling and showing, it’s simple. You could use conditionals or different forms / templates.

In my descriped way, you can easily show the bloggings with simple <txp:article />, as they appear in both: frontpage and in the archieve. For other styling, you could take advange from <txp:if_section name=""><txp:article form="frontpage_list" /></txp:if_section>, with compination of forms and other conditionals. In example I only use one template for whole site with txp – the layout is in forms.

Offline

#5 2008-03-30 12:37:11

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Understanding how Frontpage works WITH archive template

The default section does not display individual articles, it is always an article list. It is unlike any of the other sections in that ALL of your articles belong to it regardless of which section you have assigned them to. Because of this you have to use the radio buttons on the “Sections” tab to allow or disallow individual sections to appear on the front-page (default section). Originally, when your site was only your blog, the blog would appear on the front-page because you had allowed it to using those radio buttons. When you clicked on an article to go to the individual view you were, in fact, changing sections. In the default TXP setup this would normally have taken you to the “article” section which used the “archive” template or you may have changed that to the “blog” section but still using the “archive” template.

Now that you are moving more sections into your site you need to learn how to set different layouts within the same page template using conditional tags because you can only assign one template to each section (though you can use the same template for several sections). The way that you do this is to use either <txp:if_individual_article> or <txp:if_article_list> tags or you can use both. You should end up with something like:-

<txp:if_individual_article>
This is where your code for individual articles goes
<txp:else />
This is where your code for article lists goes
</txp:if_individual_article>

Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2008-03-30 15:43:03

Timid&friendly
Member
From: The Netherlands
Registered: 2006-05-28
Posts: 252
Website

Re: Understanding how Frontpage works WITH archive template

Thx again for the feedback, what lovely people you all are :-D

That all seems pretty clear.
I was hoping to avoid having to split the code into Two distinct and separate layouts in one section template, but I see that’s not possible.
I now understand that it is ONLY the frontpage that has the ability to send you to the article section which uses the archive template, because it cannot (for whatever reason) show individual_articles.

Cheers dudes, very helpful.


I think, therefore I AM, … … er … I think :-?

Offline

#7 2008-03-30 19:50:05

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Understanding how Frontpage works WITH archive template

Just for more accuracy:-

The front-page can show single articles provided that you set your article or article_custom tag “limit” attribute to 1, however this is still considered as an article_list, it just happens to be a list of one.

The front-page will link to any section, it just depends on which section the selected article belongs to and that section can use any page template of your choice or design.

Last edited by thebombsite (2008-03-30 19:53:47)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB