OnArcade 2: Template editor

From onArcade Wiki

Jump to: navigation, search

onArcade 2.2 has new template editor built into administration panel that makes editing templates easier. Template editor converts PHP tags to easier to understand pseudo code and deals with backslashes.

Using template editor

Before you can use template editor template files and template directory have to be writable by PHP. On Linux servers this usually means that you have to chmod template directory - e.g. templates/onarcade/ - to 777 and template files - e.g. templates/onarcade/main.template.php - to 666.

To access template editor you have to go to admin panel, from top menu select "Settings", on side menu select "Templates" and then click "Edit" under your template. This page lists all template files. PHP files have pages contents, CSS files have style information and files that start with "~" are backup files that are created when you change template file. Only one most recent backup is preserved.

File:Template_editor.jpg

Clicking on template file name opens template file contents. Each template file can contain multiple templates that can be loaded on different pages or inside other templates. It is also possible to add new template by clicking on "Add template" button in the bottom of the page.

Each template has a name. Name is used to call template in script or inside other templates.

Each template also has global variables list. These are the variables that can be accessed inside template, separated with coma.

Template content is inside bigger box. It is HTML with template editor pseudo code that replaces PHP tags.

File:Template_file.jpg

Template editor code

Template editor uses pseudo code to replace difficult PHP tags.

Also see

onArcade 2

Personal tools