-
Smarty Overview
Smarty Overview Vanilla currently supports both PHP and Smarty views. Smarty is a template engine that allows dynamic content to be inserted into a HTML template using tags. These tags are wrapped in curly braces: {tag}, and can represent variables or the output of a function call. They are replaced when the page is…
-
Legacy View Lookup
Once a controller method is called to handle the request, how is the xhtml of the page put together? Views. There are two types of views in Garden: “Views” and “Master Views”. A view relates directly to the controller method that called it and handles rendering content related to that request. You can typically think of a…
-
Smarty Conditionals
Smarty includes a base amount of logic that you can insert into your template. One of these is a conditional statement. A couple of basic examples should give you an idea of the syntax and format of Smarty conditionals. This example uses the user data from the controller’s data array to print out a welcome message if the…
-
Controller Assets
Assets organize content in a document. Assets are called by the main template (e.g. default.master.tpl) which renders the content currently stored in them. Assets are managed with code via plugins or the theme hooks file. Default assets Vanilla uses these assets by default: Head, Content, Panel, and Foot. You cannot rely…
-
Smarty Functions
This section outlines all the Vanilla-specific Smarty functions made available for use in your Smarty templates. You are also able to use the built-in Smarty functions in your template. Function: {debug} Opens up the Smarty debug console in a popup window. This will show you all of the data available to the smarty…
-
View Helper Functions
This is a quickstart guide to some of Vanilla’s globally available functions and methods. Familiarizing yourself with them will save you time and effort in the long term, and give you clues about how best to use the framework. This is by no means an exhaustive list, nor full signature documentation. You’ll want to find…
-
Smarty Modifiers
Smarty modifiers can be applied to variables, custom functions or strings. You can use a modifier by adding a | (pipe) after the element you wish to modify and adding the modifier name. Modifiers can also accept parameters which are separated by a : (colon). These parameters must follow the order of their appearance in the…
-
Toast Notifications
Inform Messages allow you to let users know of some action that your plugin or application has taken. Inform messages allow you to quickly and easily relay information to users, and handle actions based on interaction with those messages. Use them freely to notify users of saved forms, punishments, rewards, etc. You can…
-
Gdn_Module
If controller methods represent the main content/purpose of a page, modules represent secondary information or functions. Modules are small groupings of functionality or information on a page. Some modules that are bundled with Garden include: HeadModule - Allows addition of javascript, css & meta information to be…