change active breadcrumb items name
26. December 2015
using title(Titel) and not pageTitle (Seitentitel)
->templates->new template for “mod_breadcrumb.html5”
// $item[data][title] instead of $item[titel] 7 <?php if ($item['isActive']): ?> 8 <li class="active<?php if ($item['class']): ?> <?= $item['class'] ?><?php endif; ?> last"><?= $item['data']['title'] ?></li> 9 <?php else: ?>
Own language labels for Contao frontend
26. December 2015
in /system/config/langconfig.php
// Put your custom configuration here $GLOBALS['TL_LANG']['MSC']['more'] = 'Mehr'; if ($GLOBALS['TL_LANGUAGE'] == 'en') { $GLOBALS['TL_LANG']['MSC']['more'] = 'More'; }
Insert custom Javascript from external file
11. August 2014
<script type="text/javascript" src="{{env::files_url}}files/template/js/main.js"></script>
forms must have REQUEST_TOKEN
1. April 2013
Frontend-Modul
<input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}">
Backend-Modul
<input type="hidden" name="REQUEST_TOKEN" value="<?php echo REQUEST_TOKEN; ?>">
use contao validator
1. April 2013
$booleanVar = Validator::isEmail('email'); $booleanVar = Validator::isURL('url');
http://www.contao-docs.org/docs/Contao/html/_validator_8php_source.html
get $_GET and $_POST variable
1. April 2013
$variable = Input::get('variable'); $variable = Input::post('variable');
contao database
1. April 2013
uncached database query
$entries = $this->Database->query("SELECT * FROM table WHERE id=$id"); while ($entries->next()) { $entry = $entries->row(); }
cached database query with prepare statement
$entries = $this->Database->prepare("SELECT * FROM table WHERE email=?") ->execute($email); if($entries->numRows) { while ($entries->next()) { $entry = $entries->row(); } }
get PageId in template
20. March 2013
global $objPage; $intId = $objPage->id; if($intId != 77) : ?> <a href="{{link_url::77}}" class="button">Get it now!</a> <?php endif; ?>
or with page_id with insertags
if ('{{env::page_id}}' == '2') { echo "ID is 2"; }