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 Restaurant Menu Flip Cards Widget

By Common Ninja

Restaurant Menu Flip CardsTry 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.

Restaurant Menu Flip Cards for Wordpress logo

Restaurant Menu Flip Cards

Present dishes with restaurant menu flip cards that highlight key details, help visitors explore options easily, and support confident ordering decisions.

RSS Feed for Wordpress logo

RSS Feed

Show fresh content from any source with an RSS feed that keeps your site updated, improves navigation, and boosts user engagement.

TDEE Calculator for Wordpress logo

TDEE Calculator

Create a TDEE Calculator that helps visitors estimate daily calorie needs and make informed decisions.

X Feed for Wordpress logo

X Feed

Show posts in an X feed that keeps updates visible, improves content discovery, and helps visitors stay engaged with your latest activity.

My Reviews on Amazon for Wordpress logo

My Reviews on Amazon

Show your Amazon product reviews with My Reviews on Amazon to build trust, boost credibility, and help visitors make confident purchase decisions.

Capterra Reviews for Wordpress logo

Capterra Reviews

Show Capterra reviews to build trust, strengthen credibility, and help visitors make confident software buying decisions that support higher sales.

Engagement Toolbox for Wordpress logo

Engagement Toolbox

Use an engagement toolbox that combines forms, galleries, chats, and interactive elements to increase visitor activity and create a more engaging user experience.

Announcements for Wordpress logo

Announcements

Add announcements to your site to share important updates, keep visitors informed, and guide them toward actions that support engagement and conversions.

Image Wall for Wordpress logo

Image Wall

Showcase visuals with an image wall that creates a parallax style gallery, offers smooth scrolling, and presents images in customizable, engaging layouts.

Countdown Bar for Wordpress logo

Countdown Bar

Add a countdown bar to your site to create urgency, highlight limited time offers, and drive faster engagement and higher conversions.

Section Builder for Wordpress logo

Section Builder

Create structured layouts with a section builder that lets you design custom website sections, customize styles, and organize content for a clearer user experience.

Music Player for Wordpress logo

Music Player

Add a no-code music player to your site to stream audio, share playlists, and support multiple formats with easy setup.

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