parseFrontendTemplate

The parseFrontendTemplate hook is triggered when a front end template is parsed. It passes the template content and the template name as arguments and expects the template content as return value.

Available

from Contao 2.6.0.

Parameters

  1. string $strBuffer

    Content of the parsed front end template.

  2. string $strTemplate

    The template name (e.g. nav_default) without file extension.

Return Values

Return the original $strBuffer or override the template with your custom modification.

Example

<?php

// config.php
$GLOBALS['TL_HOOKS']['parseFrontendTemplate'][] = array('MyClass', 'myParseFrontendTemplate');

// MyClass.php
public function myParseFrontendTemplate($strBuffer, $strTemplate)
{
    if ($strTemplate == 'ce_text')
    {
        // Modify output
    }

    return $strBuffer;
}

More information

References

See also

results matching ""

    No results matching ""