NP_OrderedBlog.php

Deprecated 11/10/2006. Will soon be replaced by NP_Ordered which will do ordered category lists as well as display blog items in specific order, allow different templates for each category (even on main page), and categories that can be set to not appear on the main page.

This plugin allows a blog administrator to set the order in which each item appears. Each item can be assigned an order number. When the skinvar is used, the posts will be displayed in the order designated. Posts that are not given an order, are not shown when using the default form of the skinvar. An alternate form of the skinvar will display just the unordered posts ordered by post time. The skinvar also accepts an optional blogname parameter to display ordered posts from a different blog.

General Plugin info
Author: Frank Truscott
Current Version: 0.3
Download:
Forum Thread: http://forum.nucleuscms.org/viewtopic.php?t=14070

Installing

  1. Download and extract the zip file. Copy the NP_OrderedBlog.php file and the orderedblog directory to the nucleus/plugins directory.
  2. Use the Nucleus Admin GUI to register the NP_OrderedBlog plugin into Nucleus. Be sure to click the Update Subscription List button.

Plugin Options

There are two options that control the operation of the OrderedBlog plugin. These options are set from the edit options link in the Plugin Admin area.

  1. Show Admin Area in quick menu : Whether the OrderedBlog admin area should be shown in the Quick Menu area. yes or no. (yes)
  2. Delete SiteList data table on uninstall? : Whether the database table should be deleted on an uninstall. This should be set to yes only when permanently removing NP_OrderedBlog. yes or no. (no)

SkinVars

These skinvars should be valid in all skin types except member, error, and imagepopup:

The general form of the skinvar is: <%OrderedBlog(templatename,amount,category,blogname,show)%> where:

  • templatename : string. Required. Name of template to use to display items
  • amount : string. Optional. The amount of items to show (default = 10). Can also contain an offset telling Nucleus to start only from the given item. e.g. 10(5) shows 10 items starting from item 5
  • category : string. Optional. Name of the category to show. Defaults to current category, if set.
  • blogname : string. Optional. Short name of the blog to show. Defaults to current blog.
  • show : ordered or unordered. Optional. Sets which items to show, the ordered ones or the unordered ones. Defaults to ordered.

How to use the plugin

Use the item edit form or the plugin admin page to set the order of the items you wish to order. Then add the skinvar described above to your skins (usually the Main Index part) where you want the posts displayed. Will usually take the place of the <%blog(templatename,amount)%> skinvar.

Some usage examples are given below:

  • <%OrderedBlog(default/index,10)%>: Displays the first 10 ordered items.
  • <%OrderedBlog(default/index,3,Announcements)%>: Displays the first 3 ordered items from the Announcements category.
  • <%OrderedBlog(default/index,10,,,unordered)%>: Displays the first 10 unordered items.
  • <%OrderedBlog(default/index,10,,Static)%>: Displays the first 10 ordered items from the Static blog.

There are lot's of ways to use this plugin to do things like sticky some important announcements or posts (like an About item), to order the items in a fairly static category, but leaving the other categories as dynamic, blog-like categories. The possibilities are endless, but most uses might require some clever uses of the <%if(category,catname,CategoryName)%> skinvar and tweaks in templates to get the desired affect. If anyone wants to submit examples use cases, I will be happy to include them in this document. Submit to this forum thread.

Tips and Tricks

Wishlist

Bugs

History

  • Version 1.0, released 23 May 2006
orderedblog.txt · Last modified: 2006/11/11 02:26 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki