Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Just a little help with PHP...
I want to create a conditional structure in my template.
So, I put this code in it :
<code>
<txp:php>
global $pretext;
echo (($global [‘pretext’][‘prev_title’]==Null ?
“Previous article : none” :
“Previous article : <a href=\”“.$pretext[‘prev_utitle’].” title=\”“.$pretext[‘prev_title’].”\”>”.$pretext[‘prev_title’].”</a>” ) );
</txp:php>
</code>
…but it’s doesn’t work. And I can’t find what’s wrong. (I’m very stupid :o)
Someone could help me?
Tks by advance.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#2 2006-05-19 11:26:33
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: Just a little help with PHP...
I think you should have echo( ($pretext['prev_title']==Null ...
in your condition.
Change the echo (($global ['pretext']['prev_title']==Null ?
part.
Last edited by net-carver (2006-05-19 11:28:10)
— Steve
Offline
Re: Just a little help with PHP...
…Very good net-carver! It’s works…fine :o))
Thanks a lot.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
Pages: 1