Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-01 20:50:09

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

Organising articles and static content

Have a new site that involves a lot of static pages. I have read the articles in Textbook and the FAQ, and I don’t see an answer for what I need to do. I just want to know if its possible, and if not, help the client re-organise his site to fit in better with the way TXP works.

To make it simple, currently the client has a site which runs along these lines:

Section – lets say “News”
Page – News
Categories within news, lets say sports, world, europe.

These are examples.

If one clicks on “News” one should see a static page – one article. Other pages (categories within News) would be either a static page or with more than one article.

So far I have not managed to work this out. I have tried a variety of tags.

The current tags in the News page are:

<code><txp:if_individual_article>
<txp:article form=“article” />
</txp:if_individual_article>

<txp:if_article_list>
<txp:article form=“artcicle_list” section=“News” />
</txp:if_article_list></code>

Strangely, with the above code, with even one article in the News section, the article_list form is run.

Thanks.

Offline

#2 2005-10-01 22:08:34

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

Re: Organising articles and static content

Try this:-

<code>
<txp:if_individual_article>
<txp:article form=“article” />
<txp:else />
<txp:article form=“article_list” />
</txp:if_individual_article></code>
<br />

I’m presuming you just use a single page template for your News section? When using the “article” tag there is no need to specify the section as it is context-sensitive. If you are in one section but want to view articles from another then you would use the “article_custom” tag instead.

Also the number of articles in the section makes no difference to TXP from an article_list point-of-view. It only goes into individual_article view when you click on the title or comment link.

Last edited by thebombsite (2005-10-01 22:11:11)


Stuart

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

Offline

#3 2005-10-01 22:21:59

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

Re: Organising articles and static content

Yes I use one page template for the News section. The code is in that page – News, which is exclusively for the News section articles.

I realised that the article tag is context sensitive which is why I find this issue a bit strange. I have this now in the News page template:

<code><txp:if_individual_article>
<txp:article form=“om_skolen_article” />
<txp:else />
<txp:article form=“om_skolen_list” />
</txp:if_individual_article></code>

And the two forms in question have the following:

om_skolen_list (article type form)
<code><h3 class=“newsheading”><txp:permlink><txp:title /></txp:permlink></h3>
<txp:excerpt />
<div class=“divider” ></div></code>

om_skolen_article (article type form)
<code><txp:article_image />
<h3 class=“newsheading”><txp:permlink><txp:title /></txp:permlink></h3>
<txp:body />
<div class=“divider” ></div></code>

There is currently 1 article in the om_skolen section. The output is from the list form – easy to tell because there is no image and only an excerpt!

I meant to say the output is incorrect now – TXP is calling the list form for some reason.

Last edited by jstubbs (2005-10-01 22:23:44)

Offline

#4 2005-10-01 22:27:05

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

Re: Organising articles and static content

The slight issue I am having with article tags now is separate from the main question I have in my first post. How to structure the site in the way I mentioned. I really would prefer to use TXP natural method of doing things as much as possible but have run into a wall here.

Issue is I have to take a clients current site, transfer it to TXP, while retaining the current site structure as much as possible.

Offline

#5 2005-10-01 22:38:27

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

Re: Organising articles and static content

Clients eh. Who’d have ‘em? I think my last paragraph is pertinent here. When you navigate to the News section you are placed on that section’s front-page. No matter how many articles are in that section, even if there is only one article, TXP assumes it is in article_list view. It won’t go into individual_article mode until you either click on the title (permlink) or the comment invite if there is one.


Stuart

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

Offline

#6 2005-10-01 22:46:29

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

Re: Organising articles and static content

OK. Very interesting. Don’t quite see why it works like this – in PHP normally its an IF/ELSE statement correct? If there is one article, use the single article form, otherwise use the list articles form.

Why is it in list view? And how should one change this? (Bearing in mind the section will have quite a few articles, and I only want to show 1 pre-defined article on the front page, quite possibly without a permalink)

Offline

#7 2005-10-01 22:58:49

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

Re: Organising articles and static content

If it is a specific article then you could set it as a “sticky” and call it using your special form then call the rest underneath it with the other form if there are any. Would that work for you?


Stuart

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

Offline

#8 2005-10-01 23:04:34

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

Re: Organising articles and static content

Like I said in the first post, the client has his site set up in a way where if you click on “news” you will see one article without any hyperlink. Using a news page template, I am trying to re-create that. The issue is that within the news section there will be several categories with maybe more than one article in each category.

Edit: Why does the form go into list mode with an if call to a single article form when there is only one article?

Last edited by jstubbs (2005-10-01 23:05:29)

Offline

#9 2005-10-01 23:14:16

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

Re: Organising articles and static content

Well it seems a little confusing in that the tag really means “if_individual_article_view” rather than just asking if there is only one article or not. I’m really not the one to speak to on that point. You need a chat with one of the devs.

However back to your problem. This single article you want to look at when you go to the section front-page. Is it always the same article or does it change?


Stuart

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

Offline

#10 2005-10-01 23:18:12

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

Re: Organising articles and static content

Yes I clearly need to read more on this if individual article tag. Its not working as I thought and its up to me to work it out.

Yes, the article I want on the front of the news page should not change, but of course might be edited from time to time. The same might go for other category articles within the news section. For example, in the “world news” category (invented but should serve our purpose) within “news”, there may be 1 article, but within the “europe news” category within “news” there could be 5 articles.

Hope its clear and I DO appreciate the help.

Offline

#11 2005-10-01 23:23:51

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

Re: Organising articles and static content

And will you need to show the other aticles in the News section using the “excerpt” form on the front-page as well as this specific article or will you simply link to the different categories?

Last edited by thebombsite (2005-10-01 23:25:42)


Stuart

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

Offline

#12 2005-10-01 23:26:52

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

Re: Organising articles and static content

No I think just the article in its entirety on the front page of the news. The other articles in the various news sections should be displayed either in list form or in single article form depending on the category.

Edit: The other catgeroies will be linked, no other articles on th front page of the news section page.

Last edited by jstubbs (2005-10-01 23:31:21)

Offline

Board footer

Powered by FluxBB