TinyButStrong - the PHP Template Engine
Categories > TinyButStrong general >

conditional display only on home page

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Milop
Date: 2012-10-12
Time: 21:21

conditional display only on home page

Hi,

Is there some way to don't display some part in template only at home page ?
So, I have the same template file on home page and several other pages, but on home page I don't want to display link HOME.

And I use navbar, so there are page 2, page 3, that all use the same template.
I want to display Home link on other pages of the same template.




By: Milop
Date: 2012-10-12
Time: 21:57

Re: conditional display only on home page

Is there maybe some way to check current page URL inside template ? Like php_self ?
By: Skrol29
Date: 2012-10-12
Time: 23:56

Re: conditional display only on home page

Well, it depends on how you are managing templates.
You may have the same main script for the home page and for other pages, like in Joomla.

What ever, the solution is to store in a PH variable an indicator telling if it's the home page or not. And use this variable on a TBS field (such as [onload] or[onshow]) to delete the link.
Deleting the link can be done with parameter "magnet".