NP_ListArticlesByCategory.php

This plugin can be used to display a list of recent articles by category.

^General Plugin info ^^

Author: Metanoia
Current Version: 1.1
Code: NP_ListArticlesByCategory_code
Download: np_listarticlesbycategory_v1.1.zip
Forum Thread: here

Installing

  1. Copy and paste the code into a text editor (e.g. Notepad) and save it as NP_ListArticlesByCategory.php
  2. Install the plugin.

How to use the plugin

In your admin cp apply this change by going to your skins and editing the area of your skin where you want it to display.

Add the following line: <%plugin(ListArticlesByCategory,-1,5)%>

This can be explained by the following:

<%plugin(ListArticlesByCategory,numbertodisplay,categoryid)%>

So if you put in 50 in the “number to display” then only 50 will be shown (theoretically). -1 allows all items to be displayed.

Available SkinVars and/or TemplateVars

Options

Tips and Tricks

Show the titles of the articles per category

putting this in main skin:

<%if(category)%>
<BR>
Alle berichten in de category <h2><%category%></h2>(sortering op datum)
<BR><BR>
<%else%>
<%blog(default/index,10)%>
<%endif%>
 
<%if(category,catid,1)%>
<%plugin(ListArticlesByCategory,-1,1)%><BR><BR>
<%endif%>
<%if(category,catid,2)%>
<%plugin(ListArticlesByCategory,-1,2)%><BR><BR>
<%endif%>
 
etc (depending on how many categories you have)
 
<%endif%> 

Order the Articles

This plugin works by listing the articles in alphabetical order. But if you want to list the articles in a specific order, you can prefix a number at your article title.

Amend the title of your article to include the number:

EG:

1. My First Post
2. My Second Post

You can also prefix the title with HTML comments but that will list the newest article on top in that order.

EG:

<!-- 1 --> My First Post
<!-- 2 --> My Second Post

will results in:

My Second Post<br> My First Post

Wishlist

Bugs

If not all parameters of the skinvar are specified correct the plugin causes MySQL error messages. It would be better to offer default settings to avoid the error messages.

History

  • Version 1.1 - Fixed the SQL call and added supportsFeatures (Tim Bellette)
  • Version 1.0 - First release.

Plugin review

NP_ListArticlesByCategory version 0.1 works with Nucleus CMS version 3.31 - 2007-11-14 kg

listarticlesbycategory.txt · Last modified: 2007/11/14 14:27 (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