RYO Folding Page List & Widget

RYO Folding Page List provides a sidebar widget that displays only top level Pages plus parents and children of currently displayed Pages. If your website has lots of Pages, this can simplify your sidebar real estate considerably by displaying only Pages of current interest.

The widget’s user interface lets you set the displayed title. It displays your Pages and lets you designate which Pages should be excluded entirely from the list.

I once used a rather complex function called Fold Page List by the same author as Folding Category List. It took a long path to do the same thing as wp_list_pages(). And it didn’t upgrade well. Here it’s redone with entirely new logic that makes it fast and clean, plus there’s a powerful widget with lots of customization options. And it’s compatible with sorting functions like pageMash.

Beta test version available.

Requires: WordPress 2.8+

See all of our WordPress Plugins

Screenshots

Page Widget Display - Front Page
1. This is the display of the widget on the Front Page. Top level Pages only are shown, excluding any that were checked in the widget options.

This image reflects our theme, of course. Your website will be styled as defined in your theme.


Page Widget viewing Contact Us Page
2. This is the display of the widget when you select the “Contact Us” Page. The top level categories are still displayed, plus the children of “Contact Us,” in this case “Getting Our Email.” Children of other top level Pages do not appear.

This image reflects our theme, of course. Your website will be styled as defined in your theme.


Folding Page List Widget Options
3. This is the widget drop down options panel, illustrating how you may choose to exclude listed Pages.


Installation

  1. Download and unzip ryo_folding_page_list.zip. This will unzip to a folder called ryo_folding_page_list.
  2. Upload the ryo_folding_page_list folder to the /wp-content/plugins/ directory.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress
  4. The user interface is in the Appearance, Widgets section of the Dashboard. Customize the display there.

With WordPress 2.8 or later you can use the plugin “Upload” utility to upload and install the plugin.

Download

RYO Folding Page List Beta test ver .05

Frequently Asked Questions

Can I have more than one instance of the widget?

Yes, the current widget system allows for this.

This would allow you to have a completely separate block in your sidebar for unrelated or special Pages. It might require customization of each widget as Pages are added. But one easy way to do this would be:

  • Folding Page Widget #1: Exclude Pages D, E, F.
  • Folding Page Widget #2: Include only D, E.
  • Folding Page Widget #1: Include only F.

This lets you put certain pages (D, E, and F) in special places on your website. If you add another page which you want to appear in Widget #2, you’d have to add it to Widget #2 and Exclude it from Widget #1.

When I select a subpage, will other subpages on the same level be hidden?

That’s up to you. In normal operation, subpages on the same level (also called “siblings”) will be hidden. This means one has to go to the parent in order to choose a subpage.

If that’s not what you want check the “Include Siblings” checkbox and the other pages with the same parent will also be displayed.

How do I use this without the widget?

You call ryofpl_folding_list_pages() using the same arguments you would for wp_list_pages().

Consider it to be a direct replacement for that function. (Ultimately, it actually calls the function after excluding child pages for non-current parents.)

There is one additional argument, optional:

You can set siblings=1 if you want to display “siblings,” the other child pages to the current parent page.

Changelog

Beta .05

  • Further protection against invalid parent tree

Beta .04

  • Corrected loop error for cases where a Page had been deleted and the parent tree was not clear

Beta .03

  • Added Option to include siblings in display.

Beta .02

  • Added option to select “Exclude” or “Include Only” checked Pages.

Beta .01

  • Initial test release.

1.0.0

  • Initial release.
  • Complete rewrite to use WP internals available in WP 2.8+. Not compatible before WP 2.8.
  • New logic eliminates most database queries; more efficient, less overhead.
  • Based on original idea by Rob Schumann (http://www.webspaceworks.com/) but with entirely new logic.

Share and Enjoy:

  • Print
  • email
  • Twitter
  • Facebook
  • LinkedIn
  • Digg
  • del.icio.us
  • Google Bookmarks

13 Responses to “RYO Folding Page List & Widget”

  • Raphael:

    hello

    this is an elegant solution to an ongoing problem in wordpress. the plugin works flawlessly. though ther is one little kink. when i select a subpage, all subpages on the same level get hidden. meaning one has to go to the parent and choose a subpage. that’s not allways very handy. this could be optional.

    best raphael

  • Rich:

    Raphael, Good idea. Try this one out (.03).

  • Raphael:

    Rich Wonderful! Thank you very much! Best R

  • How to use plugin without widget?

  • Rich:

    Dmitry,

    How to use plugin without widget?

    You call ryofpl_folding_list_pages() using the same arguments you would for wp_list_pages().

    Consider it to be a direct replacement for that function. (Ultimately, it actually calls the function after excluding child pages for non-current parents.)

    There is one additional argument, optional:

    You can set siblings=1 if you want to display “siblings,” the other child pages to the current parent page. This was the request Raphael made earlier.

    (I’ve updated the documentation Q&A above to reflect this.)

  • Thank`s, I found some comments in php files of plugin, and understood that)

  • Rich:

    Is there something more I can help you with?

  • No, it is all clear! )

  • I have still got a problem :) Oh… my English is bad )))) I will try to explain:

    I have 3 pages that have many sub pages. This sub pages also have sub pages.

    I want to have 3 sidebar menus, for each kind of page.

    When i use ryofpl_folding_list_pages(‘child_of=X&siblings=1′); where X – id of the page, i cant see whole tree;

    When i use ryofpl_folding_list_pages(‘siblings=1′); It shows me all pages.

    My question – how to make folding list pages only for one page? Thank You!

  • Rich:

    The way the widget does it is to exclude pages you don’t want to see by building an exclude list. You check off pages to include, and others are excluded. OR you check off pages to exclude, and those are passed in the exclude list.

    You might try it in a widget and look at the code the widget generates, grab the code from there. Then you could pull the widget.

  • Paul:

    I have a client who has upgraded to beta and has problems. Where is the download for the initial stable release please?

  • Rich:

    Paul, this has not moved out of beta yet.

    What problems is your client experiencing? With which version of WordPress?

  • Louie:

    I need a way to be able to show the entire list of pages without them disappearing when the visitor goes to the 3rd level page, for example, I have:

    main page -sub page –sub sub page

    I need the list of sub pages to still be listed when a user goes to the sub sub page, I tried loading another instance of the widget that includes all pages, but it still hides all of the pages when you are in the 3rd level page, is there a way around this?

Leave a Reply

Powered by WishList Member - Membership Software