• Resolved Shane.C

    (@shanec-1)


    Hi,

    Is it possible to have sub-groups e.g.

    IT Support
    – Hardware
    – Software

    Project Management
    – Requesting assistance
    – Support available

    Where initially just the ‘IT Support’ and ‘Project Management’ groups would be shown and when you expand on one of them you would be presented with their sub-groups (not yet expanded) e.g. Hardware and Software which would then be able to be further expanded/drilled-down into?

    Thanks,
    Shane

    https://wordpress.org/plugins/arconix-faq/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author John Gardner

    (@jgardner03)

    Hi Shane,

    Thanks for using my plugin. In theory hierarchical taxnonomies should be supported just fine but I’ve never tested it. If you’d like to give it a shot, add the following to your theme’s functions.php file:

    add_filter( 'arconix_faq_defaults', 'my_faq_defaults' );
    function my_faq_defaults( $defaults ) {
        $defaults['taxonomy']['hierarchical'] = true;
    
        return $defaults;
    }

    That should enable nested faq groups and the plugin (again in theory) should loop through the groups just like it does now.

    Thread Starter Shane.C

    (@shanec-1)

    Hi John,

    I added the code into the middle of
    …/wp-content/themes/twentyten/functions.php
    and the good news is that the site still works fine! (I know I should be using a child theme but this is a disposable test site so I don’t mind having to remove and recreate it if everything goes to pot).

    I can’t see any change in the plugin’s UI to allow me to create sub-groups. How might I create them?

    Thanks a lot,
    Shane

    Plugin Author John Gardner

    (@jgardner03)

    That’s because I gave you bad code (I shouldn’t try to work off memory).

    add_filter( 'arconix_faq_defaults', 'my_faq_defaults' );
    function my_faq_defaults( $defaults ) {
        $defaults['taxonomy']['args']['hierarchical'] = true;
    
        return $defaults;
    }

    I forgot the ['args'] level to the array in my initial response.

    Thread Starter Shane.C

    (@shanec-1)

    Hi John,

    That’s the ticket. I can now create nested groups, thanks! The display of the FAQs on the site isn’t exactly what I was hoping for (as they aren’t visually nested on the FAQ page) – the groups and sub-groups are all displayed as if they were all at the same level e.g.

    Hardware
    IT Support
    Project Management
    Requesting assistance
    Software
    Support available

    If there was any way of displaying the above as how it’s portrayed below that would be fantastic.

    IT Support
    + Hardware
    + Software

    Project Management
    + Requesting assistance
    + Support available

    (as an example clicking on ‘Support available’ would not show one FAQ rather it would show a list of all the FAQs (not yet expanded) in the ‘Support available’ sub-category of Project Management – each of which could then be individually expanded.

    But even if this is not possible thank you anyway for your prompt responses and suggestions for the functions.php.

    Thanks,
    Shane

    Plugin Author John Gardner

    (@jgardner03)

    the groups and sub-groups are all displayed as if they were all at the same level

    To change that would require some modifications on the plugin side to see if the group being output has a parent. If so I’d need to add the particular class to the group header and then set up some CSS rules that would indent items that had a particular class. Not impossible to achieve but a bit outside of the plugin’s current design.

    As a workaround you could set up some CSS rules that would indent each FAQ group to give it the nesting appearance you’d like.

    Thread Starter Shane.C

    (@shanec-1)

    Another workaround (without needing CSS or making any changes to the functions.php code) is:

    1 Create pseudo-child FAQ groups (all at the same (top) level) e.g.
    .. it-support
    .. it-support-hardware
    .. it-support-software
    .. project-management
    .. project-management-requesting-assistance
    .. project-management-support-available

    2 Create a main FAQ page and a page for each sub-group e.g.
    .. Main FAQ Page
    .. IT Support FAQ Page
    .. Project Management FAQ Page

    3 On the main FAQ page have the following:
    .. [faq group=”it-support”]
    .. [faq group=”project-management”]

    4 On the IT Support FAQ page have the following:
    .. [faq group=”it-support-hardware”]
    .. [faq group=”it-support-software”]

    5 On the Project Management FAQ Page have the following:
    .. [faq group=”project-management-requesting-assistance”]
    .. [faq group=”project-management-support-available”]

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Sub-groups’ is closed to new replies.