Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
detecting article id?
i am making a website with the following sections:
1. Artist Statement
2. Curriculum Vitae
3. Contact
They all use the Section, Page and Form called “Information” because they are formated almost exactly the same. At the bottom of each page, there are buttons to the other pages.
My question is this: How can I hide the button for the current page?
Can I write a PHP statement that says “if article id = current id, then hide this button”? How would that be done?
OR, do I have to make a different form for each page, and include the buttons within that form?
Thanks!!
Offline
Re: detecting article id?
There’s a heap of navigation plugins that have solved this wheel before — I like Adrian’s ako_nav, there’s also Johan’s glx_hilite_current which is more flexible
You could do it yourself if you like. Try:
<txp:php>
global $thisarticle;
global $pretext;
if ($pretext["id"] == $thisarticle["thisid"])
return 'yep, this is the current article";
</txp:php>
$pretext[‘s’] is the current section, so on and so forth.
Offline
#3 2007-01-10 19:46:38
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: detecting article id?
if_article_id should work if you have version 4.0.4 TXP.
Offline
Re: detecting article id?
rsilletti, that did the trick. thanks everyone
Offline
Pages: 1