OneThird CMS

Lightweight CMS for Small website, Web application framework.

Download Document

japanese

About template tag

The basic specifications of the tag

In OneThird CMS, template files, has its own tag that can be used in the edit tags that can be used both in the text that can be edited in the time of post editing and pop-up dialog can be used

The format of the tag are as follows



And tag the start mark, describes the tag name and the parameters between the end mark


Tag list that can be used

The use of the tag has been commentary sprinkled with examples

It should be noted that, in the example of the tag so we omit the {}, please note

※ There is a tag that can be used in addition to the tag that says here, please wait for a while because we have established a document


Parameter relationship

In OneThird CMS, in addition to the $_ SERVER or, such as $_ SESSION special global variable of php

$ Config, $ params, you can use

$config is, is within the normal OneThird a fixed variable, which is set primarily in the config.php not done rewriting

$params is working variables that are changed are evaluated in OneThird such as site information and page information


The main variable

Tag name $params['data_url'] 
functionExpand the template URL 
Example http://onethird.net/files/1/data/ 
Tag name $config['site_url'] 
functionDeployment to the site of the URL
Example http://onethird.net/
Tag name $params['circle']['files_path']
functionExpand the path of the template
Example var/.....site/files
Tag name $params['login_user']
functionThe logged in user ID
(log off at 0)
Example 
Tag name $params['circle']['acc_right']
functionThe privileges of the user is logged in
Example 
Tag name $params["circle"]['url']
functionThe URL of the site
Example 
Tag name $params["request"]
function$_server [ 'Request_uri'] and about the same
Example 

※ *** _ in the case of the path in the case of *** _ url the last / it does not stick to the end / Gatsuku


$params['page']

$the params [ 'page'] is housed information about the page

Tag name Content Remarks 
params['page']['id']
page number 
params['page']['title']
Page title
params['page']['type'] Page type
 (= 1 ordinary page, reference plugin.php for details)
 
params['page']['link']  Page link 
params['page']['mode']  Image mode
(= 0 draft, = 1 Normal page)
 
params['page']['mod_date'] Page last updated  
params['page']['date'] Page creation date  
params['page']['user'] Page created user  
params['page']['tag'] tag 
 
 params['page']['meta']  Page metadata 
params['page']['block_type'] Page of the block type
(= 1 usually, = 5 inner pages) 
 

ut tag

ut tag is what was to be read the utility function for the plug-in from the template

Tag name Exterior> expand
function$continuous and returns an array of KEY in html
ParametersArgument 1: array of KEY
argument 2: Delayed flag (default, false)
※ when delayed flag is true, after the end of the tag deployment of all of the buffer, it is deployed
Example  Example

$html['test'][] = "1";

$html['test'][] = "2";

$html['test'][] = "3";

$ut->expand('test') -> "123';

Tag name ut->expand_sorted
functionSame as expand, but expand it sort an array key
Parametersut-> same as expand
Example  Example

$html['test'][2] = "a";

$html['test'][3] = "b";

$html['test'][1] = "c";


$ut->expand('test') -> "cab';



Exterior> icon

To expand the system icon


$ut->icon('edit') edit

$ut-> icon ( 'admin') admin

$ut->icon('system')

$ut->icon('save') save

$ut->icon('delete') delete

$ut->icon('remove') remove

$ut->icon('setting') setting

$ut->icon('star')

$ut->icon('add') add

$ut->icon('ok') ok

$ut-> icon ( 'ng') ng

$ut->icon('text')

$ut->icon('text2')

$ut->icon('personal')




Exterior> str

Output by combining the arguments

In the argument, if there is a bool type, evaluated as a conditional statement, not do anything when the true, when false, end deployment


Example 

$str((bool)$params['login_user'],"<a href="javascript:void(ot.show_login_panel())">login</a>")



Exterior> link

To synthesize the URL than the internal page number or alias

First parameter: number or alias name,

The second and subsequent parameters

"&:xxx"

xxx deployment to query parameters


Example

$ Exterior> link (1);

-> http://onethird.net/p1.html


$ut->link('test');

-> http://onethird.net/test


$ut->link('test','&:mode=edit');

-> http://onethird.net/test?mode=edit



link


To expand the page number in a tag


First parameter: number or alias name,

The second parameter following: number or alias name,

Third and subsequent parameters

"&:xxx"

xxx deployment to query parameters



file tag

To expand the file name

Files can be uploaded, it is selected by the system toolbar


Parameters

name: xxx <= identifier

group: yyy <= location for storing the files (installation folder / files / img / yyy /)

caption: xxx <= menu name of the system toolbar

inbfo: descriptive text to be added to the xxx <= uploader


Example

$file('name:top_img','group:top_img')



plugin tag

Read the plug-in files, to run the plug-in





call tag

Call of any function

※ You can not call a dangerous function


Example:

Installation folder /files/1/plugin/plugin.php

function test($arg)

{

return print_r($arg,true);

}


tag

$call('test')



load tag

Reading of any of the php file and less file

less files are compiled into css in compiled mode, it will be loaded as css


First parameter: php or less

The second parameter: php file or less full path of the file



Example:

$load('php',"/var/www/html/onethird/admin5/files/1/data/theme")



dump tag

Tag for debugging

Display converts the variable content into the table


Example

$dump($params)



※ If you just write out the contents of the variable, it can be substituted in the var_dump and call tag

$call('var_dump',$params)



flexedit system

div,span,edit,dl,ul,pre

Each tag, will be expanded internally to flexedit tag


Example

$div('name:xxx', .... )


Parameter settings of flexedit

parameterfunction Remarks 
name
identifier
It can not be omitted
page

Write = in the meta information of self own page

= Use the meta information of the top top page

= Number or page alias


expand
= Not performed tag deployment against false setting string 
login

= True ... a non-logged at the time does not display

= Display false ... at the time of non-login

 
 mode

= Unspecified html

= Text text

=form

=inline

 
inner_html1
 Insert a string in front of the HTML 
inner_html2 To insert the string after the HTML 
inner_tag
Tag of the element  
wrap_tag  To wrap the element tag in wrap_tag
 
list = The true element tag in the form of a list  
class The class name of the element tag  
safe-echo Display to escape the HTML 
   
height The height of the edit pop-up  
sysmenu Without displaying the edit handle is displayed on the system menu  
no-edit Do not show the edit handle  


append 

To insert the HTML statement to the HEAD tag, the end position of the BODY tag


Example

To add to the end of the header part

$append('head')


To add to the end of the BODY part

$append('meta')






Google Website Translator - Google Translate