Personal tools
Views

User Handbook/Admin Panel/Extensions/Tags

From CMSMS

This page in: English - Deutsch - Español - Français - Italiano - Lietuvių - Nederlands - Norsk - Polski - Русский - Svenska - Tiếng việt


Tags

Using a tag

Just put it where you want it in a template like <title>{title}</title>.

Tag parameters

Many tags accept parameters, which allow you to refine their output; for example: {last_modified_by} would return the ID of the last user to modify a page; {last_modified_by format='fullname'} would output that user's full name instead.
Acceptable parameters will be listed on the tag's help page.

Using a tag value as another tag's parameter

If you wish to use the value of the output of one tag as a parameter in another, use Smarty's {capture} function to assign the value to a variable:
  {capture assign='tmp'}{title}{/capture}
Then call the variable in the parameter of the second tag:
 {news category=$tmp}

Installing a tag

To install a new tag, put the function.tagname.php file into your /plugins directory. When you refresh the Tags page in the CMS, the new tag will be shown.
Occasionally, tag installation will require extra steps; see PiSearch, for example. In this case, read the instructions supplied with the new tag.

Tag specific help

Adding a parameter to a tag/plugin

Many tags/plugins are developed with default values that determine the behavior of the tag. However most tags also have optional parameters that can further refine the behavior of the tag/plugin.
For Instance, there is a plugin called "tagcloud". To add a parameter to a plugin like TagCloud, you do this...
Insert the smarty tag for the plugin into your template at the location you want the tag to show up on your web page. So for "tagcloud" you would insert the following code into the template where you want the tag cloud to appear.
 {tagcloud} 
Now if you want to also use parameters to modify the default behavior of the tag, you add them one after another in the tag that you just placed into your template. For instance, if you want to create a blacklist of words that will not show up in your tag cloud, then you enter the name of the parameter followed by a comma delimited list of the blacklisted words...
  {tagcloud blacklist="cms,template,code,cmsms"} 
If you wanted to modify more than one parameter, you would just add them to what you've already done, making sure you separate each new parameter from the previous parameter by a space.
So if you want to add a blacklist and also limit the number of tags that show in the cloud (the default is 30) you would use two parameters to do this, the "blacklist" parameter and the "max_words" parameter.
  {tagcloud blacklist="cms,template,code,cmsms" max_words="20"} 

How to use the Google Adsense Tag in CMSMS

The basic tag is {adsense}.
  • Login to your website Admin Console
  • Select "Content/Pages"
  • Click the name of the page you wish to edit
  • Type {adsense} wherever you want your adsense to appear
No - you're not done yet :-)

Adding the parameters to make it work for your unique Google account code

If you have already signed up for Google Adsense, you will have logged into that account and found the code provided by Google for all of the different ad formats. All you have to do is use the CMS Made Simple tag, and add the relevant info.
Here is a sample tag for a 120 wide and 240 high advert:
  {adsense
  ad_client="pub-1122334455whatever"
  ad_width="120"
  ad_height="240"
  ad_format="120x240_as"
  ad_type = "text"
  ad_channel = "type-OTHER-google-channel-number-here" 
  color_border = "FFFFFF"
  color_bg = "FFFFFF"
  color_link = "6600FF"
  color_url = "008000"
  color_text = "008000"
  }
  • Go ahead and put your Adsense tag into your CMSMS page.
  • Click the APPLY button, view it 'live'.
  • If you're happy with it, click SUBMIT button.

How to make the Adsense code appear on the left or right, with text flowing around it

This can be achieved very simply by using the DIV code.
BUT - the DIV code must be entered in the HTML source part of your EDIT screen - NOT THE EDIT PART - look for a little 'HTML' button in the menu for the Edit area of the Admin Panel.
  • Click the HTML button
  • a new little window opens, showing all the html code for the editable area of your page
  • find the Adsense tag, and put the DIV tag on either side of it, like this:
  <div>{adsense}</div>
  <div style="float: left; width: 140px; margin-top: 0px; margin-left: 3px">
  {adsense
  ad_client="pub-1122334455whatever"
  ad_width="120"
  ad_height="240"
  ad_format="120x240_as"
  ad_type = "text"
  ad_channel = "type-OTHER-google-channel-number-here" 
  color_border = "FFFFFF"
  color_bg = "FFFFFF"
  color_link = "6600FF"
  color_url = "008000"
  color_text = "008000"
  }
  </div>
Tip: Make the width of the DIV slightly larger than the width of the ad.
For alignment on the page, simply change - float: left; - to - float: right; - or centre.
Hope this helps!
--WebGirl 19:27, 6 October 2007 (CDT)


Anchor Tags

To put a link at the bottom of each page that directs you straight to the top of that page (or any other position) you need an anchor link
To make a proper anchor link just insert the tag into your template/page like:
{anchor anchor='pagetop' text='go up'}
It needs a target somewhere after the <body> tag:
<a name="#pagetop"> </a>

This page in: English - Deutsch - Español - Français - Italiano - Lietuvių - Nederlands - Norsk - Polski - Русский - Svenska - Tiếng Việt