layz Posted February 3, 2011 Share Posted February 3, 2011 hey guys i want to get rid of the static sidebar and instead make it dynamic so on the frontpage there is no sidebar but if i go to anything.php it will include the sidebar for anything.php. i hope this makes sense. regards 0 Quote Link to comment Share on other sites More sharing options...
layz Posted February 3, 2011 Author Share Posted February 3, 2011 i've been playing around with some php includes but nothing works (yes, i am using smarty brackets) please, if anyone has a solution, speak now 0 Quote Link to comment Share on other sites More sharing options...
simplexwebs Posted February 3, 2011 Share Posted February 3, 2011 I guess you could surround the sidebar with this code {if $filename eq "anything"} code for sidebar here {else} code instead of sidebar {/if} This would only show the sidebar on anything.php Or something like this to just hide it from the index page {if $filename eq "index"} code instead of sidebar {else} code for sidebar here {/if} 0 Quote Link to comment Share on other sites More sharing options...
layz Posted February 3, 2011 Author Share Posted February 3, 2011 hi, thanks for your input i see what you mean, but what if i have more than two pages? the idéa is to have a sidebar for every page like shared hosting, vps, dedicated, seedbox, client page etc. i've asked some friends and checked the smarty documentation, and come to this conclusion {if $filename eq "anything"} code for anything here {elseif $filename eq "anything2"} code for anything2 here {elseif $filename eq "anything3"} code for anything3 here {elseif $filename eq "anything4"} code for anything4 here {elseif $filename eq "anything5"} code for anything5 here {else} code instead of sidebar {/if} what do you think? 0 Quote Link to comment Share on other sites More sharing options...
layz Posted February 5, 2011 Author Share Posted February 5, 2011 it works! thank you! 0 Quote Link to comment Share on other sites More sharing options...
Jared Posted February 10, 2011 Share Posted February 10, 2011 Hey where is the $filename variable coming from? 0 Quote Link to comment Share on other sites More sharing options...
layz Posted February 21, 2011 Author Share Posted February 21, 2011 Hey where is the $filename variable coming from? it's from smarty 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.