1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To combat forum spam, new accounts will need to make at least one (valid) post.
    Otherwise, we will periodically purge all users without posts or that haven't confirmed their account.

Legend Filter

Discussion in 'Customizations (Themes / Templates)' started by perkiekat, May 21, 2011.

Thread Status:
Not open for further replies.
  1. perkiekat

    perkiekat New Member

    Hello,
    I want to know how I can split the legend filter into two columns instead of one to show all the categories in both. I do not mean two separate columns with same categories in each one, but two columns showing all of the categories...just split up.
    The one column seems to take up too much space vertically leaving a lot of empty space. I am using my style sheet, but just don't know how to make legends show up in both columns without showing two of the same thing.

    Thanks!
    Pkat
     
  2. ve9gra

    ve9gra Support Team

    The legend.php file is not encrypted, so if you know how to play with loops, you can modify the output to fit what you need.

    One possible option is to replace the table code for DIV... and then make the divs flow so that they're automatically distributed inside of a "holder" div. Make the holder div twice as wide as the content divs, and you'll get two columns.
     
  3. perkiekat

    perkiekat New Member

    Thank you for responding. I placed two div tags as you suggested and two show up, however, they both contain the same information. I would like to split the categories up in each div.

    Here is the code I have embedded in the page. I am not doing something right:

    <div style="float: right; width: 20%;">
    <?php require("/home/khorton/public_html/nhba2/calendar/plugins/legend-filter.php"); ?>
    </div>
    <div style="float: right; width: 20%;">
    <?php require("/home/khorton/public_html/nhba2/calendar/plugins/legend-filter.php"); ?>
    </div>

    I have attached an image to show you what it currently looks like. Just need to know how to make the categories to split up. Let's say I have 12 categories, so I would like 6 of those categories to show up in one column and the other 6 categories in the other column. Is this doable and if so, can you please let me know what I need to do. I would really appreciate it.
    Thank you,
    pkat

    [​IMG]
     
    Last edited: May 21, 2011
  4. perkiekat

    perkiekat New Member

    I am not a php guru and had to look up on w3schools to find out what a loop is. :) Anyway, seems I need to use some sort of code similar to what I have below and I am not even sure this is correct or where to place it. Any help from anyone one on the forum with this would greatly be appreciated :

    <?php
    $x=array("one","two","three");
    foreach ($x as $value)
    {
    echo $value . "<br />";
    }
    ?>
     
  5. ve9gra

    ve9gra Support Team

    That loop already exists in the legend.php file. Right now that loop is using <table> <tr> and <td> tags to create a vertical table. What I recommended was to modify that to replace it for <div>.
     
  6. ve9gra

    ve9gra Support Team

    Here's my rendition...

    Adjust the width by changing the container size on line 62, and adjust each element size on lines 71 and 80.

    Note that the container needs to be 6px larger (from my testing) than the multiple of elements you want.

    In the way it's configured now, each element is 200px, and I wanted two columns, so the container is 406px wide. Say you'd want three columns, make the container 606px.

    Simply upload the file to your /plugins folder, and adjust the filename in the require(). There's no need for any manually added div anywhere... just call the plugin.
     

    Attached Files:

  7. perkiekat

    perkiekat New Member

    Thank you. I uploaded as you instructed and then changed the require name in the website page. It works!

    How do I make the name of events clickable?
    And the Show All categories is not in there now. What do I need to do?

    I really appreciate your help with this. I could not of done this without your help. As stated before, when it comes to php code, I'm kinda lost!

    Pkat
     
  8. ve9gra

    ve9gra Support Team

    The legend is just that... a legend. It would have to be modified to include the filter functionality. You might want to simply add the filter as well.

    As for the All Categories, you need to add a variable before calling it. See the Online Docs under the plugin section.
     
Thread Status:
Not open for further replies.

Share This Page