Template Syntax

Basic Syntax

Page Object

YouDoCMS incorporates a simple template language based upon the process tags functionality of the 4D platform. Each time a page is generated YouDoCMS creates a page object and a prefs object which include the data to be incorporated into the page. Using dot notation page_o is the page object page_o.menu is the current menu object and page_o.menu.title is the title of the menu. So for this page  page_o.menu.title = "Template Syntax"

<!--#4DHTML page_o.menu.title-->  // Correct

<!--# 4DHTML page_o.menu.title -->  // Wrong cannot have a space after # or before -->

Prefs Object

The preferences object contains the default information for the website/domain. Where prefs_o is the preferences object and prefs_o.domain is equal to Settings Base URL i.e. www.youdocms.com

<base href="<!--#4DHTML prefs_o.domain-->" />

 
Tag Syntax

The following 4D Tags are supported in YouDoCMS for the inclusion of variables.

<!--#4DTEXT expression-->
<!--#4DHTML expression-->
<!--#4DINCLUDE path-->
<!--#4DBASE folderPath-->

Branching and Iteration

<!--#4DEACH variable in expression--> <!--#4DENDEACH-->

<!--#4DIF expression--> {<!--#4DELSEIF expression2-->...<!--#4DELSEIF expressionN-->} {<!--#4DELSE-->} <!--#4DENDIF-->