Question

I'm currently attempting to set up a Volusion e-commerce store at the following address: http://xlevj.jyetp.servertrust.com

My current site template makes use of a side Navigation menu, which I have designated with "Info Links".

My question is this. I would only like to show the "Info Links" menu on article pages(i.e. not product or category pages). Is it possible to somehow detect the type of page the user is currently viewing, then add a simple display:none; to the leftNav div? I know the Volusion platform has a few qwerks that could potentially make it possible, I just cant find any documentation.

Example of an article page that should show the left hand nav: http://xlevj.jyetp.servertrust.com/help.asp

Example of a product page and category page that should NOT show it: http://xlevj.jyetp.servertrust.com/Guitar-s/1820.htm

http://xlevj.jyetp.servertrust.com/Asheville-Ag505-Acoustic-Guitar-Natural-Finish-p/5697.htm

Was it helpful?

Solution

You can accomplish this a couple different ways on Volusion. The key is that there are unique elements to both the product and category pages.A simple way to do this is to detect the type of page based on the URL.

Volusion Product Page URLs all contain "-p/" (or alternatively "_p/") Volusion Category Page URLs all contain "-s/" (or alternatively "_s/")

So, you might do something like:

$(document).ready(function(){         
     var pathname = window.location.pathname;
     if(pathname.indexOf('-p/') > -1){
        $('body').addClass('product-page');
     }     
});

Then just add the appropriate CSS with a display:none for the left nav.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top