Collapsing Pages

Collapsing Pages

Wordpress plugin

Install on Wordpress

App Details

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.

What’s new?

  • 2.0.3 (2024.01.01)

    • Fixed issue with subsubpages not closing correctly
    • Got rid of some more warnings
    • Tested with 6.4.2
  • 2.0.2 (2023.12.01)

    • Got rid of some warnings
    • Updated deprecated property __experimentalGroup
    • Tested with 6.4.1
  • 2.0.1 (2023.06.16)

    • Bug fixes
  • 2.0.0 (2023.03.17)

    • Updated to use Gutenberg block
  • 1.0.1 (2016.05.09)

    • Fixed bug where sometimes setting accordion to false broke javascript
  • 1.0 (2015.08.12)

    • Compatible with WordPress 4.3
    • Fixed bug where expanding symbol showed up at lowest depth specified instead
      (thanks to tkibler for pointing it out)
    • Added option to only display pages of the current subpage
    • Added option to show top-level page (previously it was always shown)
    • Added accordion style option
    • Cleaned up widget settings
    • improved style management, including the ability to specify style per widget
    • Switched from unicode symbols to html entities
    • Not showing tags for title if empty
    • Fixed bug with title attribute of pages
    • Totally rewrote javascript

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
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, ); 
  • 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
  • showTopLevel
    • True – show top level pages (default)
    • False – only display sub-pages and below
  • currentPageOnly
    • True – show only parent and sub pages of the current page
    • False – show all pages (subject to the include or exclude parameters
      set) (default)
  • 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)

Pricing

Starting from $0 per month.

Check Out the Real Estate Listings Widget

By Common Ninja

Real Estate ListingsTry For Free!

App Info

Rating

Reviewers

No reviews

Tags

menu
navigation
pages
sidebar
widget

Developed By

robfelty

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Real Estate Listings for Wordpress logo

Real Estate Listings

Create real estate listings with a listings widget that displays properties clearly, supports customization, and helps visitors explore homes more easily.

Countdown for Wordpress logo

Countdown

Add a countdown timer to your site to highlight upcoming events or launches and encourage timely user action.

World Clock for Wordpress logo

World Clock

Display multiple time zones with a world clock widget that offers clear global times, customizable styles, and a responsive design for better user experience.

Restaurant Menu for Wordpress logo

Restaurant Menu

Create an online restaurant menu that organizes dishes, highlights key items, and helps visitors explore options with confidence.

Popup Builder for Wordpress logo

Popup Builder

Add customizable popups to your site to capture attention, deliver messages, and drive actions like signups or conversions.

Accordion for Wordpress logo

Accordion

Add collapsible content sections to your site to organize information and help users navigate content more efficiently.

Linkedin Feed for Wordpress logo

Linkedin Feed

Show LinkedIn posts in a live feed that keeps updates current, builds credibility, and helps visitors engage with your brand.

Count-Up Clock for Wordpress logo

Count-Up Clock

Track time since important events with a count up clock that displays elapsed days and hours and keeps visitors engaged.

Image Poll for Wordpress logo

Image Poll

Create interactive image polls that use compelling visuals to boost engagement, gather feedback, and help visitors vote easily.

Social Media & RSS Feeds for Wordpress logo

Social Media & RSS Feeds

Add social media and RSS feeds to your site to display fresh content, grow your online presence, and keep visitors engaged with real time updates.

Reviews Badge for Wordpress logo

Reviews Badge

Use a reviews badge to highlight your ratings, build trust at a glance, improve credibility, and help increase conversions across your site.

Device Mockup for Wordpress logo

Device Mockup

Show products, apps, or designs inside a clean device mockup that improves visualization, builds credibility, and helps visitors make confident decisions.

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms