200+
January 1, 2024
April 29, 2008
This is a very simple plugin that uses Javascript to form a collapsable set of
links in the sidebar for the pages. Every page corresponding to a given
parent page will be expanded.
It is largely based off of my Collapsing Pages and Collapsing Pages
plugins.
2.0.3 (2024.01.01)
2.0.2 (2023.12.01)
2.0.1 (2023.06.16)
2.0.0 (2023.03.17)
1.0.1 (2016.05.09)
1.0 (2015.08.12)
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
wp_list_pages
$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,
'showTopLevel' => true,
'currentPageOnly' => false,
'debug' => false,
);
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
I use this plugin in my blog at http://blog.robfelty.com
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)
IMPORTANT!
Please deactivate before upgrading, then re-activate the plugin.
MANUAL INSTALLATION
(the only option for pre 2.3 wordpress, unless you have the widget plugin installed)
Unpackage contents to wp-content/plugins/ so that the files are in
a collapsPage directory. Now enable the plugin. To use the plugin,
change the following where appropriate (most likely sidebar.php):
<ul>
<?php wp_list_pages(...); ?>
</ul>
To something of the following:
<?php
echo "<ul>\n";
if( function_exists('collapsPage') ) {
collapsPage();
} else {
wp_list_pages(...);
}
echo "</ul>\n";
?>
You can specify options if you wish. See the options section.
The above will fall back to the WP function for pages if you disable
the plugin.
WIDGET INSTALLATION
For those who have widget capabilities, (default in WordPress 2.3+), installation is easier.
Unzip contents to wp-content/plugins/ so that the files are in a
collapsing-pages directory. You must enable the Collapsing Pages plugin, then
simply go the Presentation > Widgets section and add the Collapsing Pages
Widget.
As of version 0.5.3, there are several default styles that come with
collapsing-categories. You can choose from these in the settings panel, or you
can create your own custom style. A good strategy is to choose a default, then
modify it slightly to your needs.
The following classes are used:
* collapsing – applied to all ul and li elements
* pages – applied to all ul and li elements
* list – applied to the top-level ul
* item – applied to each li which has no sub-elements
* expand – applied to a page which can be expanded (is currently
collapsed)
* collapse – applied to a page which can be collapsed (is currently
expanded)
* sym – class for the expanding / collapsing symbol
An example:
<ul id='widget-collapspage-3-collapsPageList' class='collapsing pages list'>
<li id='about-nav' class='collapsing pages item'><a href='http://blog.robfelty.com/about/' title="About">About</a>
</li>
<li id='donate-nav' class='collapsing pages item'><a
href='http://blog.robfelty.com/donate/' title="Donate">Donate</a>
</li> <!-- ending page subcat count = 0-->
<li class='collapsing pages '><span title="Click to collapse"
class='collapsing pages collapse' onclick='expandCollapse(event, "▶", "▼", 1,
"collapsing pages"); return false'><span class='sym'>▼</span></span><a
href='http://blog.robfelty.com/plugins/' title="Wordpress Plugins">Wordpress
Plugins</a>
<ul id='collapsPage-67' style='display:block;'>
<li class='collapsing pages item'><a
href='http://blog.robfelty.com/plugins/collapsing-pages/' title="Collapsing
Pages">Collapsing Pages</a></li>
<li class='collapsing pages item'><a
href='http://blog.robfelty.com/plugins/collapsing-categories/'
title="Collapsing Categories">Collapsing Categories</a></li>
<li class='collapsing pages item'><a
href='http://blog.robfelty.com/plugins/collapsing-links/' title="Collapsing
Links">Collapsing Links</a></li>
<li class='collapsing pages item'><a
href='http://blog.robfelty.com/plugins/collapsing-pages/' title="Collapsing
Pages">Collapsing Pages</a></li>
<li class='collapsing pages item'><a
href='http://blog.robfelty.com/plugins/postie/' title="Postie">Postie</a></li>
</ul><!-- subpagecount = 5 ending subpage -->
</li><!-- subpagecount = 5 ending subpage -->
<li id='forum-nav' class='collapsing pages item'><a
href='http://blog.robfelty.com/forum/' title="WP Plugin Forum">WP Plugin
Forum</a> </li> <!-- ending page subcat count = 0-->
</ul>
The current page has the “self” class. By default, the “self” class style is
set to bold. If you would like to change this, you can change it in the
settings page.
* now 'self' class gets attributed to <a> instead of <li>, 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
Initial Release
Version | Download | Type |
---|---|---|
2.0.3 | Download | Stable |
2.0.2 | Download | Stable |
1.0.1 | Download | Stable |
1.0 | Download | Stable |
0.6.1 | Download | Stable |
0.6 | Download | Stable |
0.5.3 | Download | Stable |
0.5.2 | Download | Stable |
0.5.1 | Download | Stable |
0.5.beta | Download | Beta |
0.5.alpha | Download | Beta |
0.4.3 | Download | Stable |
0.3.5 | Download | Stable |
0.2.5 | Download | Stable |
0.1.1 | Download | Stable |
Development | Download | Trunk |