First non-Lib Dem WordPress widget…

February 21, 2008: Version 1.2. Bug-fix to ensure that it works with the new datastructure in the latest versions of WordPress. A huge thank you to Will Howells for fixing this.

September 16, 2006: Version 1.1. Bug-fix to ensure that it ‘remembers’ your root page when the Widget page is updated.

Here’s the first of two new WordPress Widgets, and, for the first time, it’s not Lib Dem specific.

It lets you show a subsection of the pages of your WordPress blog. The options page for the widget shows a drop-down box of all the pages in your blog. Select one of them and only pages below that will be displayed by the widget on the menu.

I’m using it on Make IT Policy to have a menu section that only shows the pages of the Make IT Policy policy paper.

You can find the Widget here on the WordPress website.

If you already have widgets installed as part of your WordPress installation, you can try this widget out yourself. All you need to do to use it:

  1. Download the ldpagehierarchy.zip file, extract the ldpagehierarchy.php file and save it or upload it into your widget plug-ins directory.
  2. Go into the ‘Plugins’ area of your WordPress installation and activate the ‘Sub page hierarchy’ widget.
  3. Go into the ‘Sidebar Widgets’ section of the ‘Presentation’ area of WordPress, and drag your new ‘Sub page hierarchy’ widget to the desired location.
  4. Hit the configure icon, select the page that is the parent of the pages you want to show in your page hierarchy and then close the configuration box.
  5. Hit ‘Save Changes’

er, that’s it.

If you don’t have widgets installed, head off to Automaticc’s Widgets project page and follow their extremely helpful instructions on how to install widgets and add them to your blog template.

You can find lots of useful widgets via the WordPress Widgets blog.

perbandingan smartphone

Author: Martin Tod

Martin Tod is a marketing professional and Liberal Democrat living in Winchester.

12 thoughts on “First non-Lib Dem WordPress widget…”

  1. Great widget! I see this as being very useful in the site I am developing.

    I have created a Page hierarchy that is 2 levels deep (for now).

    I am curiouis to know what it would take to make the Head Page dynamic, therefore makeing the subPages display depending on what Page you have selected.

    best,
    Josh

  2. Excellent addition to the widget catalogue. I agree with Josh, making this work with other top level pages would be ideal. If you ever get that working, I’ll put you on my Christmas card list.

  3. I have a question – is it possible to have a second widget that does the same thing in the blog?

    I basically want this widget in my blog twice, for two different pages. Is this possible? Is it possible for you to do a quick tweak to the original widget to make it so that I can have more than one of them in my sidebar?

    Thanks!

  4. Hi,

    I have always used this widget with great pleasure. Now I have installed WordPress 2.1, and it is bugging a little bit: hitting the ‘configure icon’, the Head Page combo is empty: I can not select the parent page, and therefore the widget becomes useless.

    Have anyone experienced such a thing ?
    If yes, any hint to solve this ?

    Thanks in advance !

  5. John L / Nicholas,

    Many thanks for pointing this out. I didn’t know it was broken. I’ll look into it when I have a moment.

    D.B. Ferguson

    It’s probably quite a big tweak – although not impossible. It would be a easier to create a plug-in that let’s you put it into the main text. There are a couple of other things I’d like to do first – sorting the 2.1 problem – and allowing people to pick ‘this page’ as the home page…

  6. Hi Martin,

    ok waiting for your fix then: unless anyone has a workaround ? For the moment I kind of hardcode de sublist hierarchy, but it does not quite make it.

    If you realise this will be too hard/long to fiw, would you let us know ?

    Thanks for your work anyhow.

    Rgds.

Leave a Reply