Package DE_EPAGES::Presentation::API::Template
This module provides page type based template processing, including language dependend keywords.
Base |
DE_EPAGES::Dictionary::API::Template |
Example |
use DE_EPAGES::Presentation::API::Template qw (ProcessPage); use DE_EPAGES::Presentation::API::PageType qw (LoadPageTypeByAlias); use DE_EPAGES::Object::API::Factory qw (LoadObjectByPath); my $Object = LoadObjectByPath('/Shops/DemoShop'); my $PageType = LoadPageTypeByAlias('Details'); my $myContent = ProcessPage($Object, $PageType, 'en', {}); |
@EXPORT_OK |
Functions
GetTLEProcessor
Returns an instance of a TLEProcessor. If possible the object will be retrieved from cache otherwise instantiated.
Syntax |
$TLEProcessor = GetTLEProcessor(); $TLEProcessor = GetTLEProcessor($CacheName); |
Example |
$TLEProcessor = GetTLEProcessor('SitePageProcessor'); |
Input |
|
Return |
|
INCLUDE
Returns processed content of the include template. If the debugging mode for this function is enabled, an html comment wraps result (includes file name and processing time).
Syntax |
#INCLUDE(#Name, #NoDebug) |
Example |
#INCLUDE("Header") ... #INCLUDE("Footer") #INCLUDE("StyleSheet", "NoDebug") |
Input |
|
ProcessPage
Localizes a template by replacing localization tags, then replaces embedded placeholders (TLE variables). Returns the complete page content.
Syntax |
$Content = ProcessPage($Object, $ObjectPageType, $LanguageCode, $hVars, $TLEProcessor, $IncludeHandler, $TemplateName); |
Example |
my $PageType = LoadPageTypeByAlias( 'SF-Category' ); my $ObjectPageType = DE_EPAGES::Presentation::API::Object::ObjectPageType->load( $PageType, $Category ); print ProcessPage( $Category, $ObjectPageType, 'en', $Category->tleHash ); |
Input |
|
Return |
|
dictionaryFiles
Returns a list of dictionary files for a language-neutral template file.
Syntax |
$aFiles = $Handler->dictionaryFiles( $FileName, $LanguageCode ); |
Example |
$aFiles = $Handler->dictionaryFiles( 'Template.tmpl', 'de' ); |
Input |
|
Return |
|
templateFileName
Returns the path to a template file. If the file does not exist in the store directory ($ENV{EPAGES_STORES}/$StoreName/Templates/$Company/$Cartridge/$FileName), then the default template is taken from the cartridge directory ($ENV{EPAGES_CARTRIDGES}/$Company/$Cartridge/Templates/$FileName).
Syntax |
$FileName = $Handler->templateFileName( $hTemplate ); |
Example |
$hTemplate = $PageType->template( 'Page', $Object ); $FileName = $Handler->templateFileName( $hTemplate ); |
Input |
|
Return |
|