Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-06-21 15:15:48
- jrgip
- Member
- Registered: 2006-04-19
- Posts: 12
identifying current article
I am trying accomplish something that should be simple. I simply want to write a class into the navigational item associated with the currently displayed article. I tried a plugin that was created to accomplish this task but unfortunately it does not work. It seems that the $thisarticle array is not available to the plugin, as it is likely the plugin is loaded prior to it being populated. All tests show that this array is empty. After alot of searching I am at a loss about how to identify the current article other than by using $GLOBALS[id]. The only place I can get a value out of the $thisarticle array is in the form where an individual article is formatted. How can I identify the current article by something other than ID in either a plugin or in a form I am using as a navigational include.
Thanks
Jon Guip
Last edited by jrgip (2006-06-21 15:20:15)
Offline
Re: identifying current article
plugin is loaded prior to it being populated.
Thats true, try to use $pretext instead.
<pre><code>
function my_current($atts,$thing){
global $pretext;
$currentID = $pretext[‘id’];
if(!empty($currentID))
return “Current ID is $currentID”;
else
return ‘dealing with an article list’;
}
Offline
Re: identifying current article
The second code sample here adds a class to a list item to highlight the current article.
Offline
#4 2006-06-21 20:01:06
- jrgip
- Member
- Registered: 2006-04-19
- Posts: 12
Re: identifying current article
Thanks for all of your help. Wet, the site you posted in that thread is really nicely done. I love the calendar!
Offline
Pages: 1