WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms Directory
[resolved] Why no odd even classes? (5 posts)

  1. heavymark
    Member
    Posted 3 years ago #

    When using the default table view for Gravity Forms Directory, no class name is provided to even and or odd lines thus there appears no way of styling alternate row colors as done with most all tables.

    And yes, it can be accomplished with JS or with nth child CSS3 pseudo selectors, but that does not work in all modern browsers.

    Is there a reason why this is not included or how to resolve it?

    On a separate note, when using definition lists there is no way to separate entrys from each other such as a space between one block of entry fields from the next.

  2. Zack Katz
    Member
    Plugin Author

    Posted 3 years ago #

    In the directory.php file of the plugin, find this line (around line 435):
    $nofollow = ''; if($nofollowlinks) { $nofollow = ' rel="nofollow"'; }

    and add below it:

    if(!isset($evenodd)) { $evenodd = ''; }
    $evenodd = ($evenodd == ' odd') ? ' even' : ' odd';

    On the next line, find:
    class='<?php echo $rowclass;

    and replace with class='<?php echo $rowclass.$evenodd;

    ....And now you'll have even/odd row functionality.

    Regarding spacing, that's a CSS issue for now. I'll consider adding that in future versions, as will I add this functionality to the next update.

  3. Zack Katz
    Member
    Plugin Author

    Posted 3 years ago #

    Separating entries can be achieved by defining the rowstyle attribute; you can make modifications like this:

    Instead of [directory form="1"], add a rowstyle with CSS:

    [directory form="1" directoryview="ul" rowstyle="padding-bottom: 1em; border-bottom:1px solid #ccc; margin-bottom:1em;"]

  4. Zack Katz
    Member
    Plugin Author

    Posted 3 years ago #

    Well, I just updated the plugin to 2.5.1 which has the alternating rows. Please consider donating for such a quick turnaround :-)

  5. heavymark
    Member
    Posted 3 years ago #

    Thanks! I must have not signed up for notifications as I just happened to see these after logging into your support again.

    I'll try out the above this weekend.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic