Core Tags

Contents

This is a list of all tags distributed with CMS Made Simple, based on 1.6.4 (Moindou). Please feel free to add new tags and / or flesh out the documentation!

adsense

This tag will take the basic parameters that would be provided by the Google adsense program and puts them in a easy to use tag that makes your templates look much cleaner.

Usage:

   {adsense ad_client="pub-random#" ad_width="125" ad_height="125" ad_format="125x125_as"}

anchor

Inserts a link (a tag) to an anchor on a page.

Usage:

 {anchor anchor="name" text="link text" [class="class name"] [title="title text"]
         [tabindex="tab index"] [accesskey="access key"] [onlyhref="(1|true)"] }

The anchor and text parameters are required, but note that no checks are performed on either of them. Note that if onlyhref, is set to "1" or "true", it will yield a link with no class, title, or tabindex (even of those values are set). The URL targeted defaults to $_SERVER['REQUEST_URI'].

Defaults:
anchor - $_SERVER['REQUEST_URI']
text - No default.
onlyhref - false/0.

Yields:
When editing a page, the link: <a name="myanchor">Anchor links here</a> will point to an anchor such as this: {anchor anchor="myanchor" text="Go"}. On the frontend, CMSMS will show the link like <a href="http://original.request.uri/here/mypage#myanchor>Go</a>.

breadcrumbs

Breadcrumbs are a navigational technique displaying all visited pages leading from the home page to the currently viewed page. You find it under the header on this page.

Usage:

{breadcrumbs delimiter='»' initial='1'}

cms_selflink

Creates a link to another CMSMS content page inside your template or content. Can also be used for external links with the ext parameter.

Usage:

{cms_selflink page="1"} or {cms_selflink page="alias"}

cms_version

Displays current version number of CMS Made Simple. It is used on the default installation (can be seen in the footer of every page).

Usage:

{cms_version}

cms_versionname

Displays current version name of CMS Made Simple. For version 1.6.4, it will return "Moindou".

Usage:

{cms_versionname}

cms_module

This tag is used to insert modules into your templates and pages. Used for any module that you download. In the default templates, wrapper tags are used for inserting modules though. That is, a tag is made to insert a cms_module tag.

Usage:

{cms_module module='somemodulename' param1='something' param2=true}

current_date

Prints the current date and time.

Usage:

{current_date format="%A %d-%b-%y %T %Z"}

Yields:
The tag {current_date format="%A %d-%b-%y %T %Z"} prints a date like this: Thursday 10-Sep-09 13:20:35 EDT

edit

Creates a frontend link to edit the page in the Admin Panel. The link can only be seen if you are also logged into the backend.

Usage:

{edit}

embed

Allows to include (embedding) any other application into CMSMS. A common use would be to include a forum, etc.

Usage:

{embed url="http://www.cmsmadesimple.org"}

google_search

Searches your website using Google's search engine.

Usage:

{google_search}

googlepr

Displays a number that represents the Google PageRank of the page.

Usage:

{googlepr}

global_content

Inserts a Global Content Block (previously known as HTMl blob) into your template or page. As an example, the code for the footer on default themes resides in a Global Content Block.

Usage:

{global_content name='footer'}

image

Inserts an fully formatted img tag with XHTML style closure (/>).

Usage:

 {image src="filename" [height=pixels] [width=pixels] [alt=alt text]
        [title=title text] [class=class name] [addtext=arbitrary text]}

Note: "filename" is assumed to be located in $gCms->config['image_uploads_url'].

Defaults:
addtext: no default -- not used if not supplied.
alt: src filename.
class: no default -- not used if not supplied.
height: actual image height (from @getimagesize())
title: same as alt
width: actual image width (from @getimagesize())

Yields:
Assuming that myimage.gif is 27x40, the tag
{image src="myimage.gif" alt="Image Info" addtext="id='imgIDTag'"}
would produce the following:
<img src="uploads/images/myimage.gif" width="27" alt="Image Info" height="40" title="Image Info" id='imgIDTag' />

menu_text

Prints the menu text of the page.

Usage:

{menu_text}

modified_date

Prints the date and time the page was last modified. This is useful when placed in the footer or a page.

Usage:

{modified_date format="%A %d-%b-%y %T %Z"}

print

Creates a link to only the content of the page.

Usage:

{print}

root_url

Inserts the root URL of the site, as defined in the config file.

Usage:

{root_url}

Defaults:
None.

Yields:
Assume that config.php contains this line:
$config['root_url'] = 'http://my.server.name/base/url/here';
then the code The root URL of this site is {root_url}. would produce:
http://my.server.name/base/url/here.

sitemap

Prints out a hierarchical sitemap of all currently visible pages.

Usage:

{sitemap}

startExpandCollapse / stopExpandCollapse

Enables content to be expandable and collapsible. The parameter id acts as the hyperlink HTML anchor, the parameter title contains the text for the link.

Usage:

{startExpandCollapse id="expandcontent" title="Click Here"}
   Here is some text that displays when expanded. Click the "Click here" link to collapse it again. 
{stopExpandCollapse id="expandcontent" title="Click Here"} 

stylesheet

Adds a link tag referencing a style sheet. The link tag shows up wherever the tag is placed; since stylesheet tags really only belong in the <HEAD> section, try to avoid putting them anywhere else.

Usage:

 {stylesheet [name=stylesheet alias] [media=media type]}

If name is omitted, then instead of linking to a particular stylesheet, the tag inserts a series of links to all associated stylesheets. Associations are defined at the template level.

Defaults:
None.

Yields:
A tag like this {stylesheet name="my-sheet"} would produce code like this:
<link rel="stylesheet" type="text/css" href="http://my.root.url/stylesheet.php?cssid=51" />

valid_xhtml

Creates a link to the W3C HTML validation service.

Usage:

{valid_xhtml}


Template for Editors

Please use the following MediaWiki notation and schema when adding new CMSMS core tags to this page:

=== tag name ===
Description of the purpose of this tag.

'''Usage:'''
<code>
 {complete tag syntax, with all possible parameters}
</code>
Add important notes about assumptions or quirks here.

'''Defaults:'''<BR>
List and explain parameter default values here, if not set.

'''Yields:'''<BR>
If possible, add an example of the tag and of the HTML it produces.


This page in: English - Deutsch - Español - Français - Italiano - Lietuvių - Nederlands - Norsk - Polski - Česky - Русский - Svenska - Tiếng Việt - عربي - 日本語 简体中文

User Handbook/Admin Panel/Extensions/Tags/Core

From CMSMS

Arvixe - A CMSMS Partner