Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
static article without section
So far I am using the default templates that come with the Textpattern installation. I want to have a separate static article for a publication list, linked to the About article. On the other hand, I don’t want to create a section just for this page, since it will then show up on the list of sections, and I will have to exclude it everywhere there is a section list.
If I put both the About and Publications articles in the About section and make About sticky, then it shows alone for /about (good), but then /about/publications shows no article at all. Is there a way to fudge the textpattern template so that it displays the only article it has if there is no sticky article? Or is there some other way to approach this?
Offline
#2 2013-05-09 21:11:44
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: static article without section
skewray wrote:
I want to have a separate static article for a publication list, linked to the About article.
(…)
Is there a way to fudge the textpattern template so that it displays the only article it has if there is no sticky article? Or is there some other way to approach this?
Not sure if I understand you correctly. Where and when should the static article be displayed, both in About and Publications? Is Publications a section?
Offline
Re: static article without section
I was hoping to not add a Publications section, since I want to only ever have one link to the static article page. So if there is an article with the path /about/publications, how do I display it? Right now it comes up with no article displayed. I am not clear on why that is.
Offline
#4 2013-05-09 21:40:22
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: static article without section
Ah, I see. The article is still sticky? The <txp:article>
tag by default only displays live articles. If you want the individual article page to display an article no matter if it’s live or sticky, you need two article tags:
<txp:if_individual_article>
<txp:article />
<txp:article status="sticky" />
</txp:if_individual_article>
(Since it’s an individual article page, and the article tag is context sensitive, it will never display more than one article.)
Alternative is to make the article live, not sticky, but I assume you had your reasons for that?
Offline
Re: static article without section
I just looked at my code, and what I had before is
<txp:article limit="1" form="static_article" status="sticky" />
which explains what I got; /about shows the sticky About article, while /about/publications shows nothing. Adding an if_individual_article fixes the problem nicely. Thanks!
Offline
Re: static article without section
A bad side effect of this is my Publications list has a (closed) comment section at the end. I assume that the comment section is normally suppressed for sticky articles and not for live ones.
Offline
#7 2013-05-09 22:41:56
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: static article without section
skewray wrote:
I assume that the comment section is normally suppressed for sticky articles and not for live ones.
No, whether an article is sticky or live shouldn’t affect the comments behaviour as far as I know. Maybe your forms for live and static articles differ?
Offline
Re: static article without section
The page has:
<txp:if_individual_article>
<txp:article limit="1" form="static_article" />
<txp:else />
<txp:article limit="1" form="static_article" status="sticky" />
</txp:if_individual_article>
static_article itself is innocuous:
<h3><txp:title /></h3>
<p><i><txp:excerpt /></i></p>
<txp:body />
What I see is the live article has a comment section, while the sticky article has none. Both articles have comments turned off.
Offline
#9 2013-05-10 12:01:31
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: static article without section
Maybe it’s one of the comment settings in preferences? (On by default and Automatically append comments to articles) Does changing one or both make a difference?
Last edited by els (2013-05-10 12:02:51)
Offline
Re: static article without section
Before, they were both on, which I assumed I wanted, since the vast majority of the articles will be blog posts, once I write them. Turning off “On by default” didn’t help. Turning off “Automatically append” did help. What is mystifying is that before, regular blog posts (Welcome to your site!) did not show the comments, but now they do. Whatever “Automatically append” does, it isn’t doing the obvious.
All fixed!
Offline
Pages: 1