Document - Templating with ArticleManager
Author - Adam Morton <adam@jasventures.com>
Author - Eloi George <eloi@reralvidreams.com>
Updated - 12/5/2002

Templating in articlemanager is set up to allow administrators to create unique and flexible articles without too much hassle.  To get started with templating it is recommended that you take a look at the default templates provided with articlemanager to get a feel for how they work.  I will try to address further details in this document.

-------------------------------------------------------------------------------------------
TEMPLATE FILE PLACEMENT
-------------------------------------------------------------------------------------------
First off the placement of template files is very important. Template files can be stored in 2 places:

phpwebsite/themes/your_theme/templates/articlemanager/
-or-
phpwebsite/mod/articlemanager/templates/

Different template files are used in the display of various articles in ArticleManager.  They can be found in subdirectories, you can identify them by the following naming scheme:

Article Edit Screen						/templates/edit/article.tpl
Section Edit Screen						/templates/edit/section.tpl
Summary Article Display Layout			/templates/summary/default.tpl
Full Article Display Layout				/templates/article/*/title.tpl
                                		/templates/article/*/content.tpl
Section Display Layout					/templates/section/*/title.tpl
                                		/templates/section/*/content.tpl

I suggest that you copy this directory structure and store your templates under your theme directory.  This will allow you to create different looks for each theme's web articles.  However, if you find that you are simply copying your templates from one theme to another and not changing them, you may want to go ahead and dump your templates in the same type of structure under the articlemanager/templates/ directory.

Template files can be named anything you wish but they must be unique to the current theme. I would also suggest making them semi-intuitive so you know what the template is just by viewing the filename.  The filename is used in selecting a template for a new section during article creation or editing.

-------------------------------------------------------------------------------------------
TYPES OF TEMPLATE FILES
-------------------------------------------------------------------------------------------
The article and section display templates are actually a set of different layouts you can choose from while designing your article.  Each has a different display characteristic that is reflected in their names.  These are the templates that come shipped with ArticleManager:

ARTICLE TEMPLATES
    Blank
    Byline
    Dated

SECTION TEMPLATES 
    Centered Image
    Image Block Left
    Image Block Right
    Image Wrap Left
    Image Wrap Right
    No Image
    Text Only

If you create your own versions of these templates, I suggest that you use the same names but place them in the appropriate /themes/your_theme/templates/articlemanager/ subdirectory.  This way if you change to a different theme, the basic design of your sections will be preserved!


-------------------------------------------------------------------------------------------
VARIABLES IN THE TEMPLATE FILE
-------------------------------------------------------------------------------------------
When creating a new template file or editing an existing one, keep in mind that the templates are used on a per section basis, not a per article basis.  Variables in the template files are replaced with data pertaining to the current section being processed.

The usage of these variables is pretty simple, you surround the variable name with double brackets on each side and if the variable is recognized by articlemanager, it will replace it with the appropriate data.  Here is an example:

{TITLE}<br />
{TEXT}

The above template will replace {TITLE} with the title for the current section being processed and {TEXT} with the text for the current section being processed.

Below are lists of variables that can be used in the various templates:

SECTION TEMPLATES
-----------------
IMAGE 			= The image for the current section.
CAPTION 		= The image caption for the current section.
TITLE 			= The title for the current section.
TEXT 			= The body text for the current section.
PRINT_ICON 		= A linkable image for a printable view of the current article.
             	  The gif image for this icon must be stored in the "img" directory 
             	  and must be named "print.gif".
CREATED_DATE 	= The date the current article was created.
CREATED_USER	= The username of the user who created the current article.
UPDATED_DATE 	= The date the current article was updated.
UPDATED_USER 	= The username of the user who last updated the current article.


FULL ARTICLE TEMPLATES
----------------------
TITLE				= Page Title - Link to the full article
SUMMARYTEXT			= Article summary
HITS				= # of time article has been viewed
CREATED_DATE		= Date article was creastred
UPDATED_DATE		= Date article was last updated
EXPIRATION_DATE		= Date article will expire
PUBLICATION_DATE 	= Date article was published (shown)
CREATED_USER		= Author's name
UPDATED_USER		= The last editor's name
CREATED_TEXT		= "Created By: CREATED_USER on created_date
UPDATED_TEXT		= "Last Updated By: UPDATED_USER on updated_date"
PRINT_ICON			= Icon link to a printable version of the article. 
					  The gif image for this icon must be stored in the "img" 
					  subdirectory and must be named "print.gif"
BODYTEXT			= The text of the current page of the article
NAVLIST				= Linkable list of all pages within the article
NAVBAR				= Linkable list of all page numbers within the article
PREV				= Link to go to the previous page in the article
NEXT				= Link to go to the next page in the article
EMAIL				= Icon link to email the article to a friend. Not enabled yet
EDIT				= Link to edit this article if user is authorized
DELETE				= Link to delete this article if user is authorized
NUM_COMMENTS		= # of comments on this article
CATEGORY			= Shows icons for the categories that this article belongs to


ARTICLE SUMMARY TEMPLATE
------------------------
READMORE 			= "Read More" - Link to the full article
LINK 				= Link to the full article with no text
TITLE				= Page Title - Link to the full article
SUMMARYTEXT			= Article summary
HITS				= # of time article has been viewed
CREATED_DATE		= Date article was creastred
UPDATED_DATE		= Date article was last updated
EXPIRATION_DATE		= Date article will expire
PUBLICATION_DATE 	= Date article was published (shown)
CREATED_USER		= Author's name
UPDATED_USER		= The last editor's name
CREATED_TEXT		= "Created By: CREATED_USER on created_date
UPDATED_TEXT		= "Last Updated By: UPDATED_USER on updated_date"
PRINT_ICON			= Icon link to a printable version of the article. 
					  The gif image for this icon must be stored in the "img" 
					  subdirectory and must be named "print.gif"
MOREWORDS			= # of words in the article
MOREPAGES			= # of pages in this article
EDIT				= Link to edit this article if user is authorized
DELETE				= Link to delete this article if user is authorized
NUM_COMMENTS		= # of comments on this article
CATEGORY			= Shows icons for the categories that this article belongs to


ARTICLE EDITITNG TEMPLATE
-------------------------
TITLE_LABEL 		= "Title:"
TITLE 				= Box for entering the title for the current article.
LINK_BACK	 		= Clickable link back to the Main Menu
CATEGORY_LABEL 		= "Related Topics:"
CATEGORY 			= The FatCat category selection box
SUMMARY_LABEL 		= "Summary:"
SUMMARYTEXT 		= Box for entering the article summary text
SECTIONS 			= All sections for this article
INFORMATION_LABEL 	= "Article Information"
CREATED_TEXT	 	= "Created By: created_username on created_date"
UPDATED_TEXT 		= "Last Updated By: updated_username on updated_date"
PAGE_SETTINGS_LABEL = "Article Settings"
COMMENTS_LABEL	 	= "Allow Comments: "
COMMENTS_YES 		= Yes Selection Button
COMMENTS_NO 		= No Selection Button
ANON_LABEL	 		= "Allow Comments by unregistered users:"
ANON_YES 			= Yes Selection Button
ANON_NO 			= No Selection Button
PUBLICATION_LABEL 	= "Publish on:"
PUBLICATION_DATE 	= Date selection boxes
EXPIRATION_LABEL	= "Expires on:"
EXPIRATION_DATE 	= Date selection boxes
EXPIRATION_FLAG 	= Checkbox for whether this article can expire or not
PUBLICATION_TEXT	= "Publication Date: publication_date"
EXPIRATION_TEXT 	= "Expires on: expiration_date"
TEMPLATE_LABEL 		= "Page Format:"
TEMPLATE 			= Selection box to choose which template to use
SAVE_WARNING 		= Reminder to save the Selection before you save the Article
SAVE_BUTTON 		= Self-Explanatory
CANCEL_BUTTON 		= Self-Explanatory


