1. Fabrik 3.8 has been released. As usual, we strongly recommend that you backup your site (using Akeeba) before upgrading. Report any issues in the forums, we will answer promptly.

show/hide filters block

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

  1. ErnstJan

    ErnstJan Member

    Level: Community

    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

    Jaanus Super Moderator

    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

    ErnstJan Member

    Level: Community
  4. Jaanus

    Jaanus Super Moderator

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

    <script type="text/javascript">
    function toggle_visibility(id) {
    var filter = document.getElementById(id);
    if(filter.style.display == 'none')
    filter.style.display = 'block';
    filter.style.display = 'none';
    <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

    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]);

    $('toggle').addEvent('click', function(e){
    e = new Event(e);
    <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