Plugin Directory

Collapsing Pages

Options

If using the manual version, you can pass options either as an array, or using the query style, just like for other wordpress functions such as wplistpages

  $defaults=array(
    'title' => __('Pages', 'collapsing-pages'), 
    'sortOrder'=> 'ASC' ,
    'sort'=> 'pageName' ,
    'defaultExpand'=> '',
    'expand' => 0,
    'depth' =>-1,
    'inExcludePage' => 'exclude',
    'linkToPage' => true,
    'inExcludePages' => '',
    'showPosts' => false,
    'animate' => 0,
    'useCookies' => true,
    'postTitleLength' => 0
    'debug' => false,
  );
  • inExcludePage
    • Whether to include or exclude certain pages
      • 'exclude' (default)
      • 'include'
  • inExcludePages
    • The pages which should be included or excluded
  • showPosts
    • Whether or not to include posts as well as pages. Default if false
  • linkToPage
    • True, clicking on a parent page title will link to that page (default)
    • False, clicking on a parent page will expand to show sub-pages
  • sort
    • How to sort the pages. Possible values:
      • 'pageName' the title of the page (default)
      • 'pageId' the Id of the page
      • 'pageSlug' the url of the page
      • 'menuOrder' custom order specified in the pages settings
  • sortOrder
    • Whether pages should be sorted in normal or reverse order. Possible values:
      • 'ASC' normal order (a-z 0-9) (default)
      • 'DESC' reverse order (z-a 9-0)
  • expand
    • The symbols to be used to mark expanding and collapsing. Possible values:
      • '0' Triangles (default)
      • '1' + -
      • '2' [+] [-]
      • '3' images (you can upload your own if you wish)
      • '4' custom symbols
  • customExpand
    • If you have selected '4' for the expand option, this character will be used to mark expandable link categories
  • customCollapse
    • If you have selected '4' for the expand option, this character will be used to mark collapsible link categories
  • postTitleLength
    • Truncate post titles to this number of characters (default: 0 = don't truncate)
  • animate
    • When set to true, collapsing and expanding will be animated
  • useCookies
    • When true, expanding and collapsing of pages is remembered for each visitor. When false, pages are always display collapsed (unless explicitly set to auto-expand). Possible values:
      • true (default)
      • false
  • debug
    • When set to true, extra debugging information will be displayed in the underlying code of your page (but not visible from the browser). Use this option if you are having problems

Examples

collapsPage('animate=true&sort=ASC&expand=3,inExcludePages=about')

This will produce a list with: * animation on * shown in alphabetical order * using images to mark collapsing and expanding * exclude page about

Demo

I use this plugin in my blog at http://blog.robfelty.com

CAVEAT

Currently this plugin relies on Javascript to expand and collapse the links. If a user's browser doesn't support javascript they won't see the links to the posts, but the links to the pages will still work (which is the default behavior in wordpress anyways)

HISTORY

  • 0.5.1

    • Fixed menuorder option
    • Fixed problem with multiple instances
    • Fixed problems with cookies on page load
  • 0.5.beta

    • A few more tweaks
  • 0.5.alpha

    • Added option to collapse widget
    • Compatible with WP 2.8 (not backwards compatible)
    • When using manually, can specify settings directly in code
    • Changed hide and show classes to collapse and expand to avoid CSS class conflicts
    • Tweaked default styles
  • 0.4.3 (2009/05/06)

    • Fixed html validation error
  • 0.4.2 (2009/04/17)

    • Fixed bug with wrong url to images
    • Fixed bug with unicode codes showing up on page load instead of triangles
  • 0.4.1 (2009/04/16)

    • Added option for custom symbols
  • 0.4 (2009/02/17)

    • totally revised and improved style selecting methods
    • fixed settings panel issue
    • documentation now internationalized (Bernhard Reiter)
    • german localization (Bernhard Reiter)
    • Added truncate page title option
  • 0.4 (2009/02/17)

    • totally revised and improved style selecting methods
    • fixed settings panel issue
    • documentation now internationalized (Bernhard Reiter)
    • german localization (Bernhard Reiter)
    • Added truncate page title option
  • 0.3.5 (2009/02/04)

    • Updated internationalization support
    • Can now exclude and auto-expand using page slug or ID
    • Added option to make clicking on parent page expand sub-pages
  • 0.3.4 (2009/01/21)

    • removed debugging info
    • fixed settings panel
  • 0.3.3 (2009/01/20) * now 'self' class gets attributed to instead of

  • , so it doesn't apply to all subpages when a parent page is selected
    • changed 'inline' to 'block', which fixes formatting
      • If current page is a subpage, the parent page is automatically expanded in the list
  • 0.3.2 (2009/01/07)

    • added version to javascript file
    • not loading unnecessary code for admin pages (fixes interference with akismet stats page
    • 'self' tag now gets added in subpages
  • 0.3.1 (2009/01/06)

    • Finally fixed disappearing widget problem when trying to add to sidebar
    • Added debugging option to show the query used and the output
    • Moved style option to options page
    • tweaked default style some
  • 0.3 (2008.12.04)

    • can now use multiple instance of the widget
    • can also use manually
    • added option to animate expanding
    • added more options for expanding characters
    • consolidated javascript to share code with other collapsing plugins
    • moved inline javascript to footer to speed page load time
    • made styling an option (better flexibility and reduce number of http requests)
  • 0.2.5 (2008.11.01)

    • fixed bug in that autoExpand was not available to getSubPage
  • 0.2.4 (2008.10.28)

    • fixed bug with missing seventh argument to getSubPage when used recursively
  • 0.2.3 (2008.07.14)

    • Added option to automatically expand some pages
    • Added option to control the number of levels of pages which are expanded
    • Added "self" class to pages in list which match the current page. No link is made for these. CSS can then be used to style these differently
  • 0.2.2 (2008.05.23)

    • Re-fixed code so that xhtml validates
    • Added option for different expand and collapse icons
  • 0.2.1 (2008.05.01)

    • Link now spans the whole dropdown
    • Now indicates the presence of an additional submenu (doesn't work in IE 6 or less)
    • fixed html so that it validates correctly
  • 0.2 (2008.04.30)

    • Now includes the possibility of providing a drop-down menu of pages and sub-pages, instead of a nested list. Only useful for a header navigation
  • 0.1.1 (2008.04.25)

    • Can exclude pages (and sub-pages of those pages)
  • 0.1 (2008.04.23): Initial Release

Download

FYI

Compatibility beta

Your Setup

Log in to vote.

The Consensus

No data

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(11 ratings)