Ionize User Guide Version 0.9.6


General Tags

setting

Returns one website setting value

<ion:setting item="theme" />
Attribute Optional Values
item no site_title : Website title
files_path : Media folder name, without trailing slash
theme : Current theme name
google_analytics : Google Analytics code

site_title

Returns the website title as set in Settings > Website settings...

Same as <ion:setting item="site_title" />

<ion:site_title />

base_url

Returns the website base URL, with or without the lang URL.

Example : http://my_domain.tld/

<ion:base_url [ lang=”true/false” force_lang=”true/false” ] />
Attribute Optional Values Description
lang yes true / false If more than one language are defined, add the lang code in the produced URL.
force_lang yes true / false If set to true, it will add the language code to the URL, even there is only one language defined or online for the website. Can be used without the lang attribute.

theme_url

Returns the website theme complete URL, with trailing slash. Useful for accessing assets (CSS, images).

Examples : http://your_domain.tld/themes/your_theme/

<html>
<head>
    <link rel="stylesheet" href="<ion:theme_url />assets/css/style.css" />
</head>

meta_title

Displays the window's browser's title of the displayed page.
This title can be set on an article or on a page. If not set, it will return the page title.

Returns :

  1. The current displayed article meta_title value if not empty,
  2. else the page meta_title if not empty,
  3. else the current page title value.
<html>
<head>
    <title><ion:site_title/> - <ion:meta_title/></title>
</head>

meta_description

Returns :

  1. the current page Meta Description if set for the current visited page,
  2. else the website language Meta Description.
<html>
<head>
    <meta name="description" content="<ion:meta_description />" />
</head>

meta_keywords

Returns :

  1. the current page Meta Keywords if set for the current visited page,
  2. else the website language Meta Keywords.
<html>
<head>
    <meta name="keywords" content="<ion:meta_keywords />" />
</head>

current_lang

Returns the current lang code, on 2 or 3 chars

<html>
<head>
    <meta http-equiv="Content-Language" content="<ion:current_lang />" />
</head>

google_analytics

Shortcut for <<ion:setting item="google_analytics" />

Returns the Google Analytics code as set in the panel : Settings > Advanced Panel > Statistics

<!-- Code in view -->

<ion:google_analytics />


<!-- Returns -->

<script type="text/javascript">
   var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
   document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
   var pageTracker = _gat._getTracker("UA-0000000-00");
   pageTracker._trackPageview();
</script>