• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple, the Netherlands

cms_selflink tag

We need your assistance to make the documentation accurate, user friendly and understandable. Therefore we welcome any tips or suggestions regarding documentation. Thank you in advance for your contribution.

However, we will not respond to technical support questions submitted using this form. If you are having difficulty with CMSMS and cannot find the solution on this website, please submit your question appropriately on our support forum at: http://forum.cmsmadesimple.org. Please remember to follow the forum rules when posting.


This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net) Please confirm that you are not a script by entering the letters from the image

Open anchor to this point in the page Purpose

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

Open anchor to this point in the page How to use?

Just insert the tag into your template/page like:

  1. {cms_selflink page="page_alias"}

Open anchor to this point in the page Available parameters

  • page - Page ID or alias to link to.
  • dir anchor (internal links) - New option for an internal page link. If this is used then anchorlink should be set to your link.
  • anchorlink - New paramater for an internal page link. If this is used then dir ="anchor" should also be set. No need to add the #, because it is added automatically.
  • urlparam - Specify additional parameters to the URL. Do not use this in conjunction with the anchorlink parameter
  • tabindex="a value" - Set a tabindex for the link.
  • dir start/next/prev/up - Links to the default start page or the next or previous page, or the parent page (up). If this is used page should not be set.

Note! Only one of the above may be used in the same cms_selflink statement!!

  • text - Text to show for the link. If not given, the Page Name is used instead.
  • menu 1/0 - If 1 the Menu Text is used for the link text instead of the Page Name
  • target - Optional target for the a link to point to. Useful for frame and javascript situations.
  • class - Class for the <a> link. Useful for styling the link.
  • lang - Display link-labels ("Next Page"/"Previous Page") in different languages (0 for no label.) Danish (dk), English (en) or French (fr), for now.
  • id - Optional css_id for the <a> link.
  • more - place additional options inside the <a> link.
  • label - Label to use in with the link if applicable.
  • label_side left/right - Side of link to place the label (defaults to "left").
  • title - Text to use in the title attribute. If none is given, then the title of the page will be used for the title.
  • rellink 1/0 - Make a relational link for accessible navigation. Only works if the dir parameter is set and should only go in the head section of a template.
  • href - If href is used only the href value is generated (no other parameters possible). Value is page alias or ID.
    Example: <a href="{cms_selflink href="page_alias"}"><img src="" /></a>
  • image - A url of an image to use in the link.
    Example: {cms_selflink dir="next" image="next.png" text="Next"}
  • alt - Alternative text to be used with image (alt="" will be used if no alt parameter is given).
  • width - Width to be used with image (no width attribute will be used on output img tag if not provided.).
  • height - Height to be used with image (no height attribute will be used on output img tag if not provided.).
  • imageonly - If using an image, whether to suppress display of text links. If you want no text in the link at all, also set lang=0 to suppress the label.
    Example: {cms_selflink dir="next" image="next.png" text="Next" imageonly=1}
  • ext - For external links, will add class="external and info text.
    Warning: only text, target and title parameters are compatible with this parameter
  • ext_info - Used together with "ext" defaults to (external link).
  • assign - Assign the results to the named smarty variable.

Open anchor to this point in the page Syntax examples

  1. <a href="{cms_selflink href='page_alias'}"><img src="" /></a>
  2. <a href="{cms_selflink href=65}">foo</a>
  1. {cms_selflink dir='next' image='next.png' text='Next'}
  1. {cms_selflink dir='next' image='next.png' text='Next' imageonly=1}
  1. {cms_selflink ext='http://www.cmsmadesimple.org' text='CMS Made Simple website'}