Extension:Featured Content

= What Does It Do? = Featured Content is a tag extension that displays randomly selected content and one image from a collection of pages on the wiki. This extension also provides a link to the original article so that users can view more information.

= How Do I Use It? = Since this is a tag extension, all that you need to do is to embed the following tags on your page.

   

When the article is displayed, the tags will be replaced by the currently selected featured content.

Configurable Options
User configurable options can be declared in two ways. The first way is to declare them as parameters of the tag itself. This type of declaration is referred to as tag options. The second way to declare the options is to insert them between the start and end tags. This type of declaration is referred to as content options.

Tag Options
This extension does not use any tag options.

Content Options
This extension currently uses three content options to control the behavior of the displayed information.

chars controls the number of characters that are displayed. The default value is 650 characters. Once the specified limit is reached, the ...more link will be displayed. For example, chars=600 will only display 600 characters of the content before adding the ...more link

days controls the offset into the collection of articles. The default offset into the collection is 0. This value can be used to redirect the selection process to another range of pages in the collection. For example, days=12 will cause the selection process to select the page that is 12 pages away from the initial selection location.

choice controls the type of selection made. The default value of 0 indicates that a page is to be selected randomly from the collection. A value greater than 0 indicates the specific page index into the collection. This allows the user to select a specific page to display. For example, choice=19 will cause the 19th page of the collection to be displayed.

= Installation = To install this extension, add the following to LocalSettings.php: require_once("$IP/extensions/Esri/FeaturedContent_setup.php");

These files are read & executed, set permissions to 775. From the command line in the Test directory type: chmod -R 775 ./*

= How Does It Work? = This extension processes the information contained on the Wiki.GIS.com:Featured Content page. The content on this page contains multiple blocks of text in the following format:

  the article title goes here   the content of the article goes here and can span more than one line   a link to an associated image goes here    wiki thumbnail options should be placed here    the link to the page goes here  

Each day, a random number is generated that is used to select a page from the collection. This guarantees that the same page will be selected for an entire day. After the page has been selected, its data is processed and displayed on the page.

= Demonstration = Sample usages of this extension can be found on the Sandbox:Featured Content Demo page. Please note that this extension combines the functionality of both the Extension:Featured Page Content and Extension:Featured Page Image extensions. More specifically, it allows you to wrap the content around the image instead of presenting them as two separate sections.

= Credits =