• Hello! Great plugin!

    Is there an option to create a collapsible list?

    I have a list set up to go by groups (which is the month in this case), and then under that is each post by date. I would like to have the posts be collapsible under the group title.

    So say I have January – and then you click on January and the list of all the posts expand. Click on January again and they collapse.

    Any help is appreciated. Thanks!

    https://wordpress.org/plugins/w4-post-list/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shazzad Hossain Khan

    (@sajib1223)

    Open/Collapse is a JavaScript effect. You can achieve this many way, here’s one –

    Template:

    [groups]
    <h4>[group_title]</h4>
    <ul>[posts]
    <li>[post_date format="Y-m-d"] - [title]</li>
    [/posts]</ul>
    
    [/groups]
    [nav]

    Style -> JavaScript:

    (function($){
      $('#w4pl-list-73289').find('h4').click(function(e){
        e.preventDefault();
        $(this).next('ul').slideToggle();
      });
    })(jQuery);

    i tried to do exactly the same to my list but i really cant find the appropriate way! So if you can please help..
    I have this template

    <ul class="list-unstyled">
    [groups]
    <li><h4>[group_title]</h4>
    <ol>
    [posts]
    <li>
    [title]
    </li>
    [/posts]
    </ol>
    </li>
    [/groups]
    </ul>

    the id of my post list is 585 i replace it in the above javascript code but nothing changed

    here is the link of my site with the w4 postlist being on the right side.( Scroll for a bit.) What i want is when i click the year to expand all the post and when i click it again all the post must hide .. At the start no posts must be on sight . Only the years.

    i don’t know if it is too much to ask but any help would be appreciated!!

    Thread Starter Cynddylan

    (@cynddylan)

    Hello again! I used the template and javascript you provided, and it worked like a charm! One question – Is there any way to have the list default to being collapsed, and then it must be clicked to expand?

    Thank you for the plugin, and the response to my earlier question. Below is the page I’m using the plugin on, with a now-collapsible list.

    http://introductionsnecessary.com/episode-archive/episodes-date/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘W4 Post List – Collapsible Lists’ is closed to new replies.