My favorites | Sign in
Logo
             
Search
for
Updated Aug 21, 2007 by dmitry.shilnikov
Labels: FAQ, eng
KB2326684705  
Introduction to custom pages

What is custom page?

"Custom page" feature allows administrator to create and modify new pages for Glossword, in addition to pages "Top 10" and "Feedback". Pages are nested, and they have a tree structure. It means some pages (childs) could be placed under another pages (parents).

Beginning from version 1.7.0 Glossword allows to include custom PHP-code with your custom page.

Beginning from version 1.8.0 Glossword allows to export and import all custom pages at once. So you can transfer all the site contents with a click.

What variables could be used in a custom page?

There are some PHP-variables which could be used in PHP-code:

Where are code examples for custom page? =

The following example adds new variable block:dict_updated to HTML-templates with the list of recently updated dictionaries:

$oTpl->addVal( 'block:dict_updated', 
   gw_html_block_small( $oL->m('r_dict_updated'), 
     getTop10('DICT_UPDATED', $sys['max_dict_top'], 0)
   ) 
);

Includes the contents of HTML-file:

$arV['page_content'] = $oFunc->file_get_contents('templates/common/gw_info1.html');
$oTpl->addVal( 'block:', $arV['page_content']);

Includes the results of processing PHP-file:

chdir('../myproject');
$arV['page_content'] = $oFunc->file_exe_contents('myindex.php');
$oTpl->addVal( 'block:', $arV['page_content']);
chdir('../glossword');
Hosted by Google Code