Giter Site home page Giter Site logo

wolf_children_by_part's Introduction

Introduction

Wolf logo This is a plugin for Wolf CMS. It provides the functionality to return child pages sorted by a specified page-part's content.

It was authored by Christian Schorn and was discussed in the Frog forum. It has now been ported to Wolf CMS.

Usage Notes

Installation:

  1. Place this plugin (ensuring the directory is named 'children_by_part', with all contents) in the Wolf /wolf/plugins directory.
  2. Activate the plugin through the administration screen.

Usage:

children_by_part([parent-page], [page-part name], [order], [limit], [offset]) :

  • [parent-page] = the URI/identity of the page the children of which will be sorted:
    examples: $this, $this->find('slug'), Page::findById(21)
  • [page-part name] = the name of the page-part (not "body"!) to be sorted
  • [order] = can be ASC or DESC for alpha sort, ASCNUM or DESCNUM for numeric sort
  • [limit] = the number of pages to be returned (integer)
  • [offset] = an offset, to begin sort at nth child (integer)

Only the parent-page and the page-part name are required.

Example

The page called "Events" (slug = events) has a number of child pages, each with a page part called "date", where you put a date like "2011-02-14". The following code, used on the "Events" page, will then give a date-ordered listing of the child pages, with a link to the sub-page:

<h3>Event Dates</h3>

<?php foreach (children_by_part($this,'date') as $event): ?>
<h4><?php echo $event->link(),',&nbsp;',$event->content('date'); ?></h4>
<hr />
<?php endforeach; ?>
  • All child pages which have the 'date' page-part will be returned, in date order.
  • Those without the 'date' page-part will be ignored.

Changelog

0.4

  • 2011-06-11 : new location for version XML file
  • 2011-02-12 : update plugin info, i18n for id etc.

0.3

  • 2011-02-12 : numeric sort option added; doc update and tidy

0.2

  • 2011-01-26 : function name correction; doc update

0.1

  • 2009-08-13 : First Wolf release
  • 2008-10-12 : First Frog release

wolf_children_by_part's People

Contributors

dajare avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

vintzl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.