Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Existing tags with improved functionality
Doggiez has this solution
Here is how I now have it for a section:
<txp:if_individual_article>
<title><txp:article form="pageTitle" limit="1" /></title>
</txp:if_individual_article>
<txp:if_article_list>
<title><txp:section title="1" /> | <txp:sitename /></title>
</txp:if_article_list>
and the form pageTitle
<txp:title /> | <txp:sitename />
edit – not sure if the limit="1"
is needed.
Last edited by phiw13 (2005-11-30 00:15:42)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: Existing tags with improved functionality
maniqui wrote:
<code><txp:if_individual_artitle></code>
<strong><code><txp:article pgonly=“1” /></code></strong>
<code><title><txp:title /> | <txp:sitename /></title>
<txp:else />
<title><txp:sitename /></title> <!—or whatever you want to use as title —>
</txp:if_individual_article></code>
phiw13 wrote:
Unfortunately, it is a no go on my side. This outputs the whole article in the
<head>
of the page.
Oh, I though it would work.
The manual says:
Note: pgonly’ tells the tag to do the article/pagination count but not display anything. I added it so you can use pagination tags above the article list, but search result count should work also. Just make sure that, other than pgonly, both article tags are identical.
Offline
Re: Existing tags with improved functionality
Seems the article tag works but the pgonly attribute is passed over. Probably needs to be in the body of the page to work properly.
I’m glad I started this thread. Everyone is trying things they never thought of doing before. Great stuff! We can all learn.
Colak – The current TXP “if_section” tags replace “glx_if_frontpage” completely and I have no problem with them. I no longer have the plug-in installed. If they aren’t working for you I have no idea why. What version of TXP are you running?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Existing tags with improved functionality
Els – you may be able to use <code><txp:category /></code> in the head on it’s own to query if you are in a category list but I’ve tried using it with the “title=1” attribute inside the “title” tags and get no output.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#17 2005-11-30 07:51:15
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Existing tags with improved functionality
I do. Honestly. Rev 1090.
Edit: title=“y”
Last edited by doggiez (2005-11-30 07:53:00)
Offline
Re: Existing tags with improved functionality
I’ll try it again then. I’m on r1121 at the moment. I don’t think it matters what you use for the integer as long as it’s something. I always use “1”. I think it’s supposed to be an integer but it doesn’t seem to matter.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#19 2005-11-30 15:19:47
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Re: Existing tags with improved functionality
Thanks, for your explanation. I have been looking at your latest template to learn something. But i have a question.
At the moment i am showing on the frontpage only 1 sticky article and a list of articles from one category. This is the code for it (you helped me on this)
<code><txp:glx_if_category_list>
<txp:article limit=“10” />
</txp:glx_if_category_list>
<txp:glx_if_frontpage>
<txp:article_custom section=“about” form=“Single” status=“sticky” limit=1 />
<txp:article_custom category=“news” limit=“5” />
</txp:glx_if_frontpage></code>
<code><txp:if_category>
<txp:article limit=“10” />
</txp:if_category>
<txp:if_section name=”“>
<txp:article_custom section=“about” form=“Single” status=“sticky” limit=1 />
<txp:article_custom category=“news” limit=“5” />
</txp:if_section></code>
the problem is that now, the sticky article together with that one category appear everytime i want to list articles from other categories. This didn’t happen when using glx_if.
Am i doing something wrong?
thanks
Offline
Re: Existing tags with improved functionality
Try not using the “if_section” tag here. Try something like:-
<code>
<txp:if_category>
blah blah
<txp:else />
blah blah
</txp:if_category></code>
<br />
Also I don’t know what version you are using but 4.0.2 might help. I can never remember exactly when these improvements came in.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#21 2005-11-30 22:50:44
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Re: Existing tags with improved functionality
thanks, it worked
Offline
#22 2005-12-01 12:33:02
- oldi
- Member
- Registered: 2005-10-14
- Posts: 87
Re: Existing tags with improved functionality
Sorry for coming back to ask some more questions. Could you please expand a bit on the search else tag.
In order to get what i mentioned above, I followed your example
<code><txp:if_category>
blah blah
<txp:else />
blah blah
</txp:if_category></code>
and it worked perfectly. But now, if i want to use the default page for search results, i still get the same problem where the sticky article and one category appears. Have tried different options with search else tag, but no success. Is it possible to do that, or do i have to use a seperate page for results.
thanks
Offline
Re: Existing tags with improved functionality
Ooo. Now that calls for some “nesting”. Try this:-
<code><txp:if_search>
blah blah
<txp:else />
<txp:if_category>
blah blah
<txp:else />
blah blah
</txp:if_category>
</txp:if_search></code>
<br />
That should work in theory. Of course you could send your search to it’s own page and avoid this. You could also review my little trick here to keep your category listing on the same page that the articles use. With those out of the way you would have a nice clean default page. :)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline