Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-10 17:40:18

alittle116
Member
From: Brooklyn
Registered: 2005-09-14
Posts: 72
Website

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

#2 2007-01-10 18:37:50

jamiew
Archived Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

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

#4 2007-01-10 19:54:23

alittle116
Member
From: Brooklyn
Registered: 2005-09-14
Posts: 72
Website

Re: detecting article id?

rsilletti, that did the trick. thanks everyone

Offline

Board footer

Powered by FluxBB