Jump to content

Dynamic sidebar


layz

Recommended Posts

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

Link to comment
Share on other sites

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}

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated