Welcome To Macpherson Internet Utilities. 

:: Products

:: Support

:: Purchase

:: About

 

Creative News 4
anmlogo1.gif (1991 bytes) Price: $299.99 US Dollars
Version:
4.0
Platform:
Runs on: Unix / Linux, 
(Win NT/2000/XP) with Apache. 
Accessible from any web browser. 

Creative News Information Links:

:: Home :: Demonstrations - News Search, News Management Console

How to Guide Links:

:: Home :: Categories* :: Design Templates :: Installation* :: News Pages* :: News Search :: News Options* :: Trouble Shooting :: User Accounts* :: PDF How to Guide

How to: News Options - Insertion Orders

An Insertion Order is: A HTML comment which directs Creative News to publish news on a web page. 

Extra Info: Insertion Orders can be used in web pages that also contain Server Side Includes.

Insertion orders can be used to limit the news which is published on the news page in several ways.

  • Limit news to one category. ( -c )

  • Only publish a set number of articles. ( -n )

  • Only publish articles from a specific date, or date range. ( -d )

  • Sort articles in many methods. ( -s )

  • Format all articles with the same style. (Define an over-riding design template.) ( -dt )

  • Set the 'Include Sub Categories' option which will determine whether or not to publish articles from sub categories. ( -i )

An Insertion Order consists of a HTML comment tag, an unique number, and news switches. Here is a very basic Insertion Order (IO):

<!--ANM-0-" -c='Top Stories' "-->

The category of articles to publish is specified with the news switch "-c='Category Name' ". This IO will add all of the articles in the category 'Top Stories' to the web page. 

Insertion Orders must have a Unique Number. In the example above, '0' is the number used. If '0' was used on another web page, the last insertion order encountered would be used as default, and there would be a duplicated section of news.

Each IO must also have a corresponding closing tag:

<!--ENDANM-0-->

Note: All Insertion Orders must be at the beginning of a line, and there cannot be any other HTML tags, or text before them. The entire Insertion Order must be on one line, except for the closing tag '<!--ENDANM-x-->' which must not be on the same line as the opening tag.

If you wanted to include articles from all of the sub-categories in 'Top Stories' you can add another news switch (-i='yes or no'):

<!--ANM-0-" -c='Top Stories' -i='yes' "-->

<!--ENDANM-0-->

News Switches:

There are currently 6 news switches. Switches must be placed between the Quotation marks in an Insertion Order:

<!--ANM-0-"  Switches go here   "-->

Each switch is listed in the table below.

Switch Example Purpose
-c='Category name' -c='Top Stories' To Select which Category of news will be published.
-d='date' -d='today' Selects which date or dates will be published.
-i='yes or no' -i='no' Determines whether articles in    sub-Categories will be published.
-dt='design Template Name' -dt='Top Stories DT' Used to override the selected Design Template.
-s='sorting method' -s='title' Used to sort articles.
-n='Number of Articles' -n='5' Determines how many articles will be published.

Switch ( -c=' ' ) Explained

This switch selects the category of news that will be published. If you would like articles from all categories, use the example switch below:

-c='x'

When you have sub-categories of news, use this switch in combination with the (-i='yes') switch. This will allow you to publish articles from the main category, plus articles from sub-categories.

To publish Articles from one sub-category only, enter the full category name. You can use the 'Edit Article Form' for reference. Example Insertion Order of the Category 'Oil City' which is a sub-category of 'Top Stories':

<!--ANM-1000-" -c='Top Stories:Oil City' -i='no' "-->

This will publish news from the Category 'Top Stories:Oil City' but it will not publish articles from 'Top Stories:Oil City:Government'. If you modify the switch (-i='no') to (-i='yes') it will publish news from both  categories.

Switch ( -n=' ' ) Explained

The news switch (-n=' ') is used to select the number of articles you would like to add to a page. Here is an example:

<!--ANM-2000-" -n='5' -c='Top Stories' "-->

This will publish the top five articles from the category 'Top Stories'. Creative News will select the five articles with the HIGHEST order-numbers for publishing, unless another sorting option in used. You can select any number (positive numbers only) of articles with the (-n=' ' ) switch.

Switch ( -i=' ' ) Explained

The (-i='') switch is used to specify whether articles from sub-categories of the specified category will be published. The default value for this switch is 'no'. If you do not want sub-category articles to be published, you do not need to use this switch. If you do want sub-category articles published, add this switch to the Insertion Order as shown:

<!--ANM-3000-" -c='Top Stories' -i='yes' "-->

<!--ENDANM-3000-->

If there are articles in the sub-category 'Top Stories:Oil City', they will be published with the articles from 'Top Stories'.

See the (-c=' ') switch for a more in depth explanation.

Switch ( -s='' ) Explained

The (-s='') switch is used to sort articles with one of 24 sorting options. Article can be sorted based on the alphabetical or numeric order of any article field. The sort can also be reversed by prefixing 'reverse.' to any sort method.

Here is a table of all of the sorting options.

Active News Manager Sorting Options.

ordernumber photofile
reverse.ordernumber reverse.photofile
category photocap
reverse.category reverse.photocap
title intro
reverse.title reverse.intro
date thumbnail
reverse.date reverse.thumbnail
author approved
reverse.author reverse.approved
priority story
reverse.priority reverse.story

Example:

<!--ANM-3500-" -c='Top_Stories' -s='priority' "-->
<!--ENDANM-3500-->

Switch ( -d=' ' ) Explained

This is probably the most useful switch. With (-d=' ') you can select articles to publish from any day. There are several formats for selecting articles based on there date. The most logical is to simple enter the date of the articles you would like to publish. Example:

<!--ANM-4000-" -d='07/07/2002' -c='x' -i='yes' -n='x' "-->

This will cause ANM to publish all of the articles that were added on '05/07/2002'.

Note: You should always include two (2) digits for the month and date, and four (4) for the year.

The only problem with specifying the date is that when tomorrow rolls around, you will need to change the date switch to '07/08/2002'. That is where Date Substitutes come in handy. Date substitutes can be used to select articles from Today, Yesterday, This Week, Last Week, This Month, Last Month, This Year, Last Year, x Days Ago, Last x Days.....etc. Here is an example with the Date Substitute 'Today'.

<!--ANM-4005-" -d='today'   -c='Top Stories' -n='5' " -->

<!--ENDANM-4005-->

Fairly easy.... Here is a table with other available Date Substitutes:

Date Substitute Example Publishes:
today -d='today' All articles from today.
yesterday -d='yesterday' All articles from yesterday.
last x days -d='last 30 days' All articles added within the last 30 days.
x days ago -d='7 days ago' All articles added 7 days ago.
this week -d='this week' All articles added after the beginning of the week, Sunday.
last week -d='last week' All articles added after last Sunday until last Saturday.
this month -d='this month' All Articles added during this month.
last month -d='last month' All Articles added last month
this year -d='this year' All Articles added this year.
last year -d='last year' All Articles added last year.

Switch ( -dt=' ' ) Explained

The (-dt=' ') is a Design Template Override. Each Article can have its own Design Template when it is saved. If you would like articles to be displayed with a standard Design Template, you can use the (-dt=' ') switch to override each articles Design Template (DT).

Here is an example. The column of news on the left has an insertion order that does not contain the Design Template Override (DTO) option. The column of news on the right was imported via a Insertion Order that does contain a DTO. The news on the left is formatted with the DT selected for each article. The news on the right was formatted with the DT selected to Override each articles DT.

Design_Template_Override.gif (12333 bytes)

The Design Template Override option was added to allow news to be formatted with the DT selected for each article on one page, while allowing another page to contain another style with the same format for each article.

To Override Design Templates, add the (-dt=' ') switch to your insertion order, with the Design Templates name as the value. Here is an example use of a Design Template Override.

<!--ANM-5000-" -c='Top Stories" -d='today' -n='5' -i='yes' -dt='Top Stories' "-->

<!--ENDANM-5000-->

If you specify a Design Template that does not exist, news will not be placed on the page. It will appear as thought there was no news that fit the Insert Order's specifications.