WildDisease
Junior Member
- Aug 3, 2011
- 109
- 5
Hello,
I am pretty knowledgeable in PHP even though Im self-taught but Im having trouble with editing my smarty template files..
It is so critical too since it is part of the header template and concerns meta keywords/descriptions for all my pages
Basically Im trying to code my header template file to check what page or URL the viewer is on and output a pair of meta keywords/descriptions hard coded depending on what page it is
In PHP I would use $_SERVER or PHP_SELF variables and if then else to check what page the person is on
1) I cant use the smarty designated {literal} or {php} tags to code it using PHP in the template files because for some reason, they just just skipped over.. although I can paste javascript like adsense right into the template without using {literal} (I cant use JS)
2) If I try to code PHP in the template files without these tags, it blanks the page
3) I tried to use {if {$smarty.server.SCRIPT_NAME}=="index.php"} but nothing actually happens.. I use apache rewrite if that matters
{$smarty.server.SCRIPT_NAME} is the equivalent of PHP SELF
I am pretty knowledgeable in PHP even though Im self-taught but Im having trouble with editing my smarty template files..
It is so critical too since it is part of the header template and concerns meta keywords/descriptions for all my pages
Basically Im trying to code my header template file to check what page or URL the viewer is on and output a pair of meta keywords/descriptions hard coded depending on what page it is
In PHP I would use $_SERVER or PHP_SELF variables and if then else to check what page the person is on
1) I cant use the smarty designated {literal} or {php} tags to code it using PHP in the template files because for some reason, they just just skipped over.. although I can paste javascript like adsense right into the template without using {literal} (I cant use JS)
2) If I try to code PHP in the template files without these tags, it blanks the page
3) I tried to use {if {$smarty.server.SCRIPT_NAME}=="index.php"} but nothing actually happens.. I use apache rewrite if that matters
{$smarty.server.SCRIPT_NAME} is the equivalent of PHP SELF
Last edited: