Templates

Template structure and multiple languages


Templates contain the HTML code. They can be nested. This is useful to split up components like header, footer or navigation into separate templates and include them from the main template later on.

Websites usually require multiple templates like one column or two column layouts. We recommend you to avoid HTML code in user selectable templates (where “Active” is checked) but make them include other templates only. This is good practice to keep your HTML code in one place. Have a look at how the demo handles it:

<?php
// Two columns template
// Define constant SITE_TYPE
define('SITE_TYPE', 'col2');
?>
<!-- Request the template containing the HTML code -->
REX_TEMPLATE[3]

The main template with ID 3, containing most of the HTML code, checks for the page type. Segments like header and footer are included from separate templates. This probably helps you focus on particular sections when working with code. However, you can store all your code in a single template, if you like to.

<?php
// Content will show up in full column layout if global variable is "col1".
if (SITE_TYPE == 'col1') {
echo '
<div class="container mtb">
<div class="row">
'.$this->getArticle('1').'
</div>
</div>';

// Use 2/3 width main column with 1/3 width side column if global variable is "col2".
} elseif (SITE_TYPE == 'col2') {
echo '
<div class="container mtb">
<div class="row">
<div class="col-lg-8">
'.$this->getArticle('1').'
</div>
<div class="col-lg-4">
'.$this->getArticle('2').'
</div>
</div>
</div>';
}
?>





2Rad Sport Ondrey GmbH

Bahnhofplatz 1
2544 Leobersdorf

Phone+43 (0) 2256 215 02
Contact E-Bike and Fahrrad: fahrrad@2rso.at
Contact Motorcycle: motorrad@2rso.at

Opening hours

Mo.closed all day
Di. - Fr.08:30-12:00 and 14:00-18:00
Sa.08:30 – 12:00
(Not accessible by phone)
ArrivingNavigate with Google