Loading...
 

Templates Best Practices

 Warning

1. The content of this page is mostly obsolete. 2. Should this be on themes.tiki.org instead as per Where ?

Smarty

Tiki uses Smarty template engine

HTML

Minimal Conforming HTML5 Template
<!DOCTYPE html>
<html>
	<head>
		<title>Conforming HTML5 Template</title>
	</head>
	<body>
		
	</body>
</html>

General layout of a template:

Tiki's main template file is tiki.tpl

Tiki CSS Layout schema



TikiCSSschema

Older stuff

[+]

Template includes

Title

Smarty : templates/tiki-edit_blog.tpl
{title help="Blogs" url="tiki-edit_blog.php?blogId=$blogId" admpage="blogs"}
{tr}Edit Blog:{/tr} {$title}{/title}

Find

Smarty : templates/tiki-admin_forums.tpl
{if $channels or ($find ne '')}
  {include file='find.tpl' _sort_mode='y'}
{/if}


Include TPL

Smarty : templates/tiki-view_tracker.tpl
{include file='tracker_item_field_input.tpl'} <= Using simple quote calling TPL without variable
{include file="$checkbox.tpl"} <= Using double quote when calling TPL with variable

Remarksbox

Smarty : tiki-mods.tpl
{remarksbox type="tip" title="{tr}Tip{/tr}"}
    {tr}Tiki "mods" are additional features not included in the public release. 
Learn more at <a target="tikihelp" href="htt+p://mods.tikiwiki.org">mods.tikiwiki.org</a>.{/tr}
{/remarksbox}

Buttons

Smarty : tiki-syslog.tpl
<div class="navbar"> or <div id="page-bar">
   {button _text="{tr}Log SQL{/tr}" href="tiki-sqllog.php"}
</div>


or (if not in navbar or page-bar)

Smarty : tiki-syslog.tpl
{button _text="{tr}Log SQL{/tr}" href="tiki-sqllog.php"}

Tables

Definition of a table

Smarty : tiki-syslog.tpl
{cycle values="even,odd" print=false}
<table class="normal">
  <tr class="head">
    <th>......</th>
  </tr>
  <tr class="{cycle}">
    <td>.......</td>
  </tr>
 ...
</table>

Table can have different classes

  • normal: is usually a 100% large, with a border, the table is used to list items
  • formcolor: is usually a 100% large, with a border, the table is used in a form

td classes and styles

td can have a class depending of the type of the content

  • checkbox: for a column with checkboxes for selecting some values
  • action: for a list of action (usually can not be wrapped - or have a limited size
  • char: for a single character e.g. {text-align: right}
  • integer: {text-align: right}
  • icon: for one icon
  • email: {text-align: "@"}
  • floatnum: {text-align: "."}
  • date: ...should we add "longdate" and "shortdate" ?
  • username: for names. E.g in bold
  • norecords: for table with no records
  • id: for id {text-align: center}
  • ...


By default a td with no class is for text = left align

Notes:

  • Avoid inline styles if possible (inline styles are possible if they are required to keep the page structure consistent). No inline style should specify size, colour or fonts.


Alias

Related

http://themes.tikiwiki.org/Template+Tricks


Page last modified on Wednesday 27 September, 2017 14:27:24 GMT-0000

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Group
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend, alert + Social Bookmarking
Terms and Conditions
Theme
TikiTests
Timesheet
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools