Saulyx Posted January 21, 2011 Share Posted January 21, 2011 Hey guys, Quick question, how can I determine if the page is home page?(for he tpl files) Also how can I turn off cache? As im doing template editing Also is there a main layou file that I can edit? like the file that includes header, footer, and main page body? as I want to add a file for sidebar and have it included only on some pages and not all(as now its in the header) Thanks, S 0 Quote Link to comment Share on other sites More sharing options...
Damo Posted January 21, 2011 Share Posted January 21, 2011 You can check for the homepage using $smarty.server.PHP_SELF != '/index.php' If you use this check in header.tpl you will be able to optionally include the sidebar by checking which template you're currently in. You don't need to turn off caching. If your template files change then they are used instead of the cached copy (i.e. when the template hasn't changed). 0 Quote Link to comment Share on other sites More sharing options...
Saulyx Posted January 24, 2011 Author Share Posted January 24, 2011 You can check for the homepage using $smarty.server.PHP_SELF != '/index.php' If you use this check in header.tpl you will be able to optionally include the sidebar by checking which template you're currently in. You don't need to turn off caching. If your template files change then they are used instead of the cached copy (i.e. when the template hasn't changed). Thank you for the first suggestion, will try that, However caching doesnt seem to work that way as if I change the file it still doesnt change(even after pressing F5), I have to delete the files myself, the auto reload seems to only apply to style sheets(which is udnerstsndable as it looks like they dont get cached, Any other options? Thanks, Saulius 0 Quote Link to comment Share on other sites More sharing options...
Saulyx Posted January 24, 2011 Author Share Posted January 24, 2011 that code doesnt seem to work? Im including it in the header? got a code {if !$loggedin && $smarty.server.PHP_SELF == '/index.php'} however it shows it on all pages, And as for the caching it doesnt seem to work that way for me Thanks, Saulius 0 Quote Link to comment Share on other sites More sharing options...
Saulyx Posted January 24, 2011 Author Share Posted January 24, 2011 sorted that out now, was wrong path 0 Quote Link to comment Share on other sites More sharing options...
Damo Posted January 25, 2011 Share Posted January 25, 2011 What browser are you using? It's possible that it's your browser cache that's displaying the old page. Try a CTRL-Refresh or set your browser to pull the page everytime (i.e. no local caching). 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.