1. Hugh is now back at work, more or less full time, after a slower than expected recovery from his neck surgery early this month. Obviously we have a backlog of support to clear, and are working as hard as we can to take care of it. If you have an unanswered thread more than 3 days old, please post one (and only one) "bump" on it, to move it in to our "last 3 days" list. If you have an unanswered issue in a forum you no longer have access to due to subscriptions timing out, please use the Contact Us form, and provide us with the URL to the thread.

show/hide filters block

Discussion in 'Community' started by ErnstJan, Apr 13, 2012.

  1. ErnstJan Member

    Level: Community
    Hello,

    I found a usefull thread from Keroman about this, but I got one question left. He says:

    "Then, included in the template the code for a link or a button to toggle the filters block:

    PHP Code:
    <a id="toggle">link Text</a>

    Where do I have to put this code? Which php-file of the template?

    Just let me know.


    Kind regards, ErnstJan
  2. Jaanus Active Member

    Level: Community
    Can you also post the link?
    I did something similar for me. Just internesting whether the solution that you mentioned is somehow better.
  3. ErnstJan Member

    Level: Community
  4. Jaanus Active Member

    Level: Community
    Shortly after javascript code, I think.
    Like I did. My version of the code is slightly different, but makes the necessary work:

    HTML:
    <script type="text/javascript">
    <!--
    function toggle_visibility(id) {
    var filter = document.getElementById(id);
    if(filter.style.display == 'none')
    filter.style.display = 'block';
    else
    filter.style.display = 'none';
    }
    //-->
    </script>
    <p style="font-weight:bold;"><a href="#" onclick="toggle_visibility('filtertable');">SEARCH(show/hide)</a></p>
     
    where filtertable is the first word of class name of the html table where the filter fields are placed. The toggle link shows or hides this table.
  5. ErnstJan Member

    Level: Community
    show or hide filters block

    Hello Jaanus,

    I tried yours without succes. After that I added code Keroman in file default_filter.php
    It does show or hide filters block:

    <script language="javascript" type="text/javascript">
    window.addEvent('domready',function() {
    var myFx = new Fx.Slide($$('.fabrikFilterContainer')[0]);
    myFx.hide();

    $('toggle').addEvent('click', function(e){
    e = new Event(e);
    myFx.toggle();
    e.stop();
    });
    });
    </script>
    <a id="toggle">Show or hide filters</a>

    but moving over link it doesn't show a "hand" like in link "Export to CSV" (moving over with mouse) Any idea why? I also want to show little icon "search" before text. How to do that?
    Just let me know.

    Kind regards and thanks for taking time, ErnstJan

    Kind regards, ErnstJan

Share This Page