Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: articles only from certain category
Question: How do i get the article title into the title element (page title) when viewing a single article in a section (a quazy static page)?
Offline
#26 2006-02-10 17:36:53
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: articles only from certain category
You can use conditional tags in the page title. I use something like this:
<code><title><txp:sitename /> -<txp:if_section name=”“><txp:if_category> <txp:category title=“y” /><txp:else /> <txp:site_slogan /></txp:if_category></txp:if_section><txp:if_section name=”“><txp:else /> <txp:section title=“y” /></txp:if_section><txp:if_individual_article> <txp:category title=“y” />: <txp:article limit=“1” form=“title” /></txp:if_individual_article></title>
</code>
In article form ‘title’ is only <txp:title />
.
NOTE that you can only use an article tag here if you have set ‘Automatically append comments to articles?’ in admin > preferences to ‘no’.
Last edited by doggiez (2006-02-10 17:38:27)
Offline
Re: articles only from certain category
NOTE that you can only use an article tag here if you have set ‘Automatically append comments to articles?’ in admin > preferences to ‘no’.
BTW what does that do? Does it mean that I have to manually call the comment form to the article? It says nothing when you click the littel question mark in the admin area.
Offline
#28 2006-02-10 18:06:18
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: articles only from certain category
That’s right. Read the FAQ: Comment display confusion.
Offline
Re: articles only from certain category
I’m having trouble with this auto appending thing, I have turned it off in order your code to work for the title doggiez, but I get the comments twice even though I have turned auto append off. I use th form “Single” to display the full article and at the end of it I have tried adding:
<pre>< txp:comments_display /></pre>
but it doesn’t display anything (my comments_display form contains all necessary for the comments to appear), thae I have “hardcoded” my comments_display form into the Single form which looks like this:
<pre><!— start comments —>
< txp:if_comments>
< h3 id=“komentari”>Komentari na ovaj članak</h3>
< txp:comments />
< txp:else />
< h3 id=“komentari”>Nema komentara</h3>
< /txp:if_comments>
< txp:comments />
< txp:if_comments_allowed>
< txp:comments_form />
< /txp:if_comments_allowed>
< txp:if_comments_disallowed>
< p>
Komentari na ovaj članak su zatvoreni.
< /p>
< /txp:if_comments_disallowed></pre>
and it still it double adds them. What am I doing wrong?
EDIT:
OK, I got it, it needs to go to the page template, not the Single article form.
Last edited by Dragan (2006-02-16 20:29:44)
Offline
#30 2006-02-16 22:51:46
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: articles only from certain category
OK, I got it, it needs to go to the page template, not the Single article form.
No, it doesn’t, the single article form is the right place… But you’ve got two <txp:comments />
tags, I think that’s the problem.
Offline
Re: articles only from certain category
Yeah, that was it probably :)
Hey, I got another issue, If I have sort of a two column layout on the home page, one is displaying articles from one section, and the other one is displaying articles from a different setion. I manage category listings in the way thebombsite explained, but how do I do searches?!
Offline
#32 2006-02-17 10:09:16
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: articles only from certain category
Dragan wrote:
but how do I do searches?!
Sorry, that’s not enough information for me ;) Please tell us what it is that you want to achieve.
Offline
#33 2006-02-17 10:12:04
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: articles only from certain category
Offline
Re: articles only from certain category
Yeah, that is what I needed, to display search results. Since I include articles on home page twice I guess TXP doesn’t know what to do.
Guess what I need is a way to tell TXP to use the page archives (where I display full articles) when it fetches search results. Or am I totaly off with my approach here?
Offline
Re: articles only from certain category
got it working, check it out at http://herbiv.org, it is very crude since I have no time for styling now, I have a concert to go to. :)
Anyway there’s the link to the website all these questions were for, hope you like it and thanx endlessly for all your generous help. :)
Offline
#36 2006-02-17 18:09:23
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: articles only from certain category
Great! Makes me hungry, a pity I can’t read it…
Offline