conditional text to make content appear/not appear on the Home page

Options

With the help of Dave Hart, we were able to write some conditional code that would customize our eCommerce wrapper so that if a user is on the Home Page, they see the top nav but no left nav and if they are on all other pages, they see side left nav, but no top nav. The nice thing about this code is that it could be used to customize the wrapper on any page for which you have a WYSIWYG component. Here's how it works:

*Place on home page (or the page that you want to conditionalize in the wrapper):*

]

*Place in wrapper:*

]::homepage::

<!-- Content for homepage -->

<!--CONTENT THAT YOU WANT TO APPEAR ON THE HOMEPAGE GOES HERE---->

::

<!---CONTENT THAT YOU WANT TO APPEAR ON EVERY OTHER PAGE GOES HERE---->

<!-- Content for all other pages in the security category -->

]]

]

Tagged:

Comments

  • Nice bit of code there. Just used it for a similar situation and it worked out great.

    Thanks for posting.

Categories