Skip to content

Available variables in template

Lucas Verney edited this page Aug 23, 2014 · 3 revisions

Here is a list of the available variables to be used in templates.

  • $start_generation_time is the timestamp of the beginning of the page generation (float).
  • $feed_baselink is the baselink to be used for feeds links (to take into account the fact that URL rewriting may or may not be enabled).
  • $tag_baselink is the same thing as $feed_baselink but for tags.
  • $user is either false if the user is not connected or a stdClass with the fields id, login, salt, remember_tokenandis_admin(meaning you can access them with$user->idand so on). Please note that you SHOULD NOT usesaltandremember_token` as these are only used in the backend.

Index view only

  • $view is the expression of the current view (for instance $tag_TAG).
  • $entries is the array of entries matching the current view.
  • $feeds is an array containing all the feeds.

Settings view only

  • $error is an array {'type', 'title', 'content'} containing the last encountered error. content is a HTML formatted content (paragraphs in most cases).