Support » Plugins and Hacks » Foldable page list (WP 1.5)

  • I have a plugin that will automatically expand only the sub-pages of the currently selected page in a page list, collapsing all others to their parent page. Expansion reveals one level deeper than the currently selected page, down to a maximum level determined by the value of the ‘level’ argument.

    So, for a hierarchy consisting of:

    Fruit
    – Apples
    — Red
    — Green
    – Pears
    — Soft
    — Hard
    Vegetables
    – Beans
    — Runner beans
    — Broad beans
    – Greens
    — Cabbage
    — Lettuce

    With nothing selected and level=3, it would show as:

    Fruit
    Vegetables

    Selecting Fruit would show:

    Fruit
    – Apples
    – Pears
    Vegetables

    Selecting Apples would reveal

    Fruit
    – Apples
    — Red
    — Green
    – Oranges
    Vegetables

    Selecting Vegetables would reveal

    Fruit
    Vegetables
    – Beans
    – Greens

    etc…

    It should retain all functionality of the standard wp_list_pages plugin since it is implemented as merely a modified (& renamed) version of that tag, but adds the selective unfolding of the page hierarchy. Syntax is identical to its precursor tag.

    A page explaining installation and use, and a link to a downloadable zip archive is available at http://www.webspaceworks.com/wp-plugins/foldpagelist.html.

    I hope others might find it useful, and welcome any feedback.

Viewing 15 replies - 16 through 30 (of 43 total)
  • Tnks 4 the quick fix …

    Unf. that didnt “cut the mustard” .. i get a new error when i load the wswwpx_fold_page_list (‘?depth=2’); from my sidebar.

    —snip—-
    Warning: in_array(): Wrong datatype for second argument in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/fold_page_list.php on line 230
    # Kommande Lajv
    Warning: in_array(): Wrong datatype for second argument in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/fold_page_list.php on line 243

    —-/ /—- (and so on four all my depth=2 Pages entrtys. )

    But if i click on the link “Kommande Lajv” the menu loads collapsed and everything works fine …. (no errors)

    My WP site is located in my web root folder (not in a subdirectory) has this something to do with the error ?

    Oops again… this is embarassing… what comes of trying to do too much all at the same time, and not checking…

    Get rid of the question mark in the call, so that it reads:

    wswwpx_fold_page_list (‘depth=2’);

    As per wp_list_pages syntax.

    That should work… honest!

    The test install I have running is also at the domain root, not in a subdirectory, so that arrangement should not have any negative effect, and anyway, fold_page_list is intended to work exactly the same way as the wp_list_pages tag, upon which it is based.

    Many apologies for the previous wrong info.

    Thanks for clearing the syntax thing up… (but that didnt help eather)
    This thing is not funny .. som function is not playing well with my webpage …
    i still get error when i load the meny (see full error msg. http://trollpack.sverok.net/2005/04/26/test-sida/ )

    Thank for trying but i dont think i can get this to work 🙁
    I will enable the funktion on the main page …(at the bottom of the sidebar) so you can have a look.. (http://trollpack.sverok.net)

    Henrik,

    Can you contact me at the email address in the header of the file. I think I have a fix, but am unable to duplicate the problem (which is odd, because I think I know the cause!! The error messages were most helpful in that regard).

    OK, I think I’ve fixed it… the error was occuring when there was no page ID provided from which to determine ancestry, so no array of ancestors.

    A version fixing this problem, fold_page_list v1.0b3 is now available.

    Let me know if this works for you.

    Thanks ! that last fix realy working great 🙂
    your patience is very impressing 😉

    I realy think this plug is worth integrate in the main WP 1.5 branch ..
    If you use the site for other things than a blog this is a excelent way to get a nice site navigation.

    I have uploaded and activated the plugin, yet nothing has changed and I still see all of the child pages. see here: http://blog.knowledgerocker.net/

    How are you calling the tag? Should look something like this:

    wswwpx_fold_page_list (‘depth=2’);

    contained within php delimiters and probably inside sidebar.php for your active theme.

    The ‘depth=2’ part can be replaced with any of the arguments you would normally use with wp_list_pages

    I’ve got the fold list plugin to work, finally (I didn’t know you had to hack “sidebar.php” – I’m still new to php and WordPress), and very lovely it is too.

    However, it seems to break XHTML validity…

    Thanks for the note about xhtml validation… the output of closing tag on each list item was wrongly nested with respect to an extra ‘if’ block in the function generating the output, so wasn’t being written into the xhtml. Silly error… fixed!

    New beta (1.0b4 [rc1]) now available

    Superb! My site is now valid xhtml 🙂

    Thanks for the update – the fold page plugin is deeply appreciated…

    Bugfix:
    Thanks to Laurent for reporting a problem with duplicating sub-pages in the output when non-zero ‘child_of’ argument is supplied.

    A new version Fold Page List 1.0b5 [rc2] that fixes this problem, is now available for download.

    Today was my first day using WordPress. I couldn’t believe how much could be accomplished in one day and how much know-how, expertise and design have been contributed.

    But the problem of foldable menus plagued me all day and you folks have solved it with this perfect plug-in. This puts WordPress one step closer to being a CMS.

    WordPress and its community are really amazing. I have never had LESS frustration with an Open Source product and I have used several.

    Hi! What can I do to exclude the parents and only show its siblings and children?

    This is quite dirty but I used tbr_is_decendant_of()
    and wp_list_pages(). Basically, I checked if the page is a descendant of a page “category” and if so, I used that category’s id as the value of the child_of parameter of wp_list_pages()

Viewing 15 replies - 16 through 30 (of 43 total)
  • The topic ‘Foldable page list (WP 1.5)’ is closed to new replies.