Collapse facets by default

Dec 9, 2009 at 7:45 AM

Hi 

Is it possible to have all the facets collapsed per default and the extend/open the one you wish to refine you rsearch with?

With many facets and a lot of documents the page become rather long. 

Regards

Nikolaj

Developer
Dec 9, 2009 at 4:56 PM
Edited Dec 9, 2009 at 5:00 PM

It is possible via customization. The OOB solution doesn't have provisioning for initial collapase-all.

Jan 14, 2010 at 6:36 PM

Hi

You can use Jquery and just hide or show the web part as per your requirement, it's really easy we have done on out environment let me know if you need a source code.

 

HI ddade

 

Can you please update me that when source code would be realsed for facet 3.0 or if I can get even what is it current so that we can use it in our environment.

 

Thanks

Bharat

Jan 15, 2010 at 4:26 AM

I assume this will allow me to collapse (hide) the entire webpart and not just the faceted search properties?

ALthough this was not my original intention, it will certainly do as a workaround. A snip of code would be great.

 

Regards

Nikolaj

Jan 20, 2010 at 2:42 PM

<div id="ShowHideBlock">
    <div id="ShowBlock">
        <img border="0" title="Show Options" src="/Style%20Library/VMware/images/PLUS.gif" />
        <a href="javascript:ShowHimeOptions('s')">Show Options...</a>
    </div>
    <div id="HideBlock" style="display:none;">
        <img border="0" title="Hide Options" src="/Style%20Library/VMware/images/MINUS.gif" />
        <a href="javascript:ShowHimeOptions('h')">Hide Options...</a>
    </div>
</div>

<script language="javascript" type="text/javascript">
$(document).ready(function()
{
    var OptionBlock = $('table[class=ms-bold]');
    if(OptionBlock != null)
    {
        if(OptionBlock.length > 0)
        {
            OptionBlock[0].style.display = "none";
        }
    }    

});

function ShowHimeOptions(action)
{
    var OptionBlock = $('table[class=ms-bold]');
    if(OptionBlock != null)
    {
        if(OptionBlock.length > 0)
        {
            if(action == "s")
            {
                OptionBlock[0].style.display = "";
                document.getElementById('ShowBlock').style.display = "none";
                document.getElementById('HideBlock').style.display = "";
            }
            else
            {
                OptionBlock[0].style.display = "none";
                document.getElementById('ShowBlock').style.display = "";
                document.getElementById('HideBlock').style.display = "none";
            }
        }
    }    

}
</script>