So after searching for quite some time and messing with all kinds of files. I found it the simple way to make an accordion style left nav. It really is too simply and you do not have to change any xsl files or any configs. There are two files you will need to format to do this:
(I will give the path to them)
skins>Skin_1(Now this could be whatever skin you are using)>hometemplate.ascx
skins>Skin_1(Now this could be whatever skin you are using)>style.css
That's it only those two files. Here are the edits you will need to make.
First open the hometemplate.ascx in the head add this code to Javascript:
Code:
<!--
function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != "block" ) {
el.style.display = 'block';
}
else {
el.style.display = '';
}
}
//-->
Now to send this javascript something to work with go to leftHeader and add this:
Code:
<a onClick="switchMenu('yourVariableGoesHere');" title="Accordion" style="cursor:hand;cursor:pointer;"></a>
So your leftWrap will look like this:
Code:
<div id="leftWrap">
<div class="navHeader">Browse (!StringResource Name="AppConfig.CategoryPromptPlural"!)</div>
<div class="leftNav" id="categories">(!XmlPackage Name="rev.categories"!)</div>
<div class="navHeader"><a onClick="switchMenu('manufacturers');" title="Switch the Menu" style="cursor:hand;cursor:pointer;">Browse (!StringResource Name="AppConfig.ManufacturerPromptPlural"!)</a></div>
<div class="leftNav" id="manufacturers">(!XmlPackage Name="rev.manufacturers"!)</div>
<div class="navHeader">Browse (!StringResource Name="AppConfig.SectionPromptPlural"!)</div>
<div class="leftNav" id="departments">(!XmlPackage Name="rev.departments"!)</div>
<div class="navHeader">Help & Info</div>
<div class="leftNav" id="helpbox">(!Topic Name="helpbox"!)</div>
</div>
That is an example with what it will look like with content.
You are done with the hometemplate.ascx you may save and close that doc. Now open style.css, this will be simple it is just one thing to add. Here is the code:
Code:
#divTagID
{
/* The expandable lists */
display:none;
}
So you will pulling it from the div class leftNav call it's ID. Here is what mine looks like:
Code:
#manufacturers
{
/* The expandable lists */
display:none;
}
Here is the place I pulled the ID from:
Code:
<div class="navHeader"><a onClick="switchMenu('manufacturers');" title="Switch the Menu" style="cursor:hand;cursor:pointer;">Browse (!StringResource Name="AppConfig.ManufacturerPromptPlural"!)</a></div>
<div class="leftNav" id="manufacturers">(!XmlPackage Name="rev.manufacturers"!)</div>
I hope this helps out if you have any questions please feel free to contact me. Good luck and have fun!