Loading...
 
Insert a Smarty function or variable

Plugin Smarty

Introduced in Tiki5

Use this wiki plugin to insert a Smarty function in a page. Smarty is the template engine used in Tiki.

Parameters

Insert a Smarty function or variable
Introduced in Tiki 5. Required parameters are in bold.
Go to the source code
Preferences required: wikiplugin_smarty

Parameters Accepted Values Description Default Since
name word The name of the Smarty function that the plugin will activate. Available functions can be found at lib/smarty_tiki/function.(name).php and vendor_bundled/vendor/smarty/smarty/libs/plugins/function.(name).php 7.0


In addition, the smarty function parameters that are required or allowed should or may be set. The functions available can be found as separate files on the server for each function (name) as follows:

  • lib/smarty_tiki/function.(name).php
  • vendor/smarty/libs/plugins/function.(name).php

Examples

Function to add a button

This code:

Copy to clipboard
{smarty name="button" href="Search" _text="Search"}


Would produce:
Search

Variables

Smarty variables can be displayed by using the eval Smarty function. The available Smarty variables for a page can be viewed by Admins by clicking the "Smarty debug window" option in the Quick Administration menu. Or add ?show_smarty_debug=1 to the page address (or &show_smarty_debug=1 if there are already other url parameters). See below examples.

Smarty variables - page name

This code:

Copy to clipboard
{smarty name="eval" var="{$page}"}


Would produce on this page:
PluginSmarty

Smarty global variables - domain name

Global variables can be accessed too, such as the domain name -
This code:

Copy to clipboard
{smarty name="eval" var="{$smarty.server.HTTP_HOST}"}


Would produce on this site:
doc.tiki.org

Preferences - metatag keywords

This code:

Copy to clipboard
{smarty name="eval" var="{$prefs.metatag_keywords}"}


Would produce on this site:
documentation, tiki, tikiwiki, document, help, install, wiki syntax


Created by sylvie. Last Modification: Wednesday 07 August, 2019 09:15:04 GMT-0000 by Yves Kipondo.

doc.tiki.org

Get Started

Admin Guide User Guide

Keywords

Keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):

Accessibility (WAI and 508)
Accounting
Articles and Submissions
Backlinks
Banners
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Link Cache
Calendar
Category
Chat
Clean URLs
Comments
Communication Center
Compression (gzip)
Contacts (Address Book)
Contact us
Content Templates
Contribution
Cookie
Copyright
Credit
Custom Home and Group Home Page
Date and Time
Debugger Console
Directory of hyperlinks
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
Draw
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Groups
Hotword
HTML Page
i18n (Multilingual, l10n)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
Kaltura video management
Karma
Live Support
Login
Logs (system & action)
Look and Feel
Mail-in
Map with Mapserver
Menu
Meta Elements
Mobile Tiki and Voice Tiki
Module
MultiTiki
MyTiki
Newsletter
Notepad
Payment
Performance Speed / Load
Permissions
Platform independence (Linux-Apache, Windows/IIS, Mac, BSD)
Polls
Profiles
Profile Manager
Report
Toolbar
Quiz
Rating
Feeds
Score
Search engine optimization
Search
Search and Replace
Security
Semantic links
Shadowbox
Shadow Layers
Share
Shopping cart
Shoutbox
Slideshow
Smiley
Social Networks
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Stats
Surveys
Tags
Task
Tell a Friend, alert + Social Bookmarking
TikiTests
Theme CSS & Smarty
Tiki Manager
Trackers
Transitions
User Administration including registration and banning
User Files
User Menu
Watch
WebDAV
Webmail
Web Services
Wiki History, page rename, etc
Wiki Syntax
Wiki structure (book and table of content)
Workspace
WSOD
WYSIWYCA
WYSIWYG
XMLRPC

Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki