Templates

Register an Account
 
 
Article Tools Display Modes
  #1  

Templates

Templates

The Pligg default template is Wistie. A number of other free (open source) and for-purchase templates are available through the Pligg Templates forum.

Pligg uses the Smarty template engine. Smarty separates application data from presentation. This allows users to edit the way that their site looks and functions without having to modify the php files that handle the main processes.
Template files (.tpl) contain presentation mark-up (HTML, CSS), while content data is delivered through Smarty tags, enclosed in curly brackets: { ... }. Smarty also allows presentation logic from within template files, such as including one template inside of another
.

 

Templates - Contents

About Templates


This Pligg Wiki book entry titled "Templates" will guide you though how Pligg templates work, how to modify them and how to add new templates to your Pligg website. It will discuss both beginner and advanced techniques for customizing your Pligg templates. By the end of this template guide you should have a better understanding of what each template file controls, how to use conditional statements to display content on specific pages and how to become a better template designer.

Smarty Variables


Smarty has several different types of variables. The type of the variable depends on what symbol it is prefixed with (or enclosed within). Variables in Smarty can be either displayed directly or used as arguments for function attributes and modifiers, inside conditional expressions, etc. To print a variable enclose it in the delimiters, for example: {$pligg_language} will print your Pligg site's language.

To list all of your available Smarty variables you can enter the following code into any of your template files for it to print all of the variables:
Code:
{php}
$myVars = $this->get_template_vars();
$this->assign('myVars',$myVars);
{/php}
{foreach from=$myVars key=k item=i} 
   {literal}{${/literal}{$k}} = {$i}
{/foreach}

Templates

Contributors: Yankidank, tbronson
Created by tbronson, 11-03-2007 at 10:32 PM
Last edited by Yankidank, 03-11-2010 at 11:53 AM
2 Comments , 11693 Views
 

Tags
how to, template

Article Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Started a few free templates Danny Questions and Comments 10 10-23-2010 12:46 AM
[ask]How to insert Upload Module to a templates ucupzzz Questions and Comments 4 04-09-2009 03:07 AM
Uploaded Templates do not show in the list exstatic Questions and Comments 2 08-11-2008 09:24 PM
New Fresh Series v9.7 Pligg Templates!! crakez Templates for Sale 17 12-05-2007 04:40 AM
Pligg Templates for Sale / Custom Templates Available carpathios Templates for Sale 3 11-15-2007 11:47 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development