Creating TypoScript HTML Markers
Each Zen Series HTML template contains TypoScript HTML markers that are parsed and replaced with dynamic content for various extensions such as dynamic login form, search engine form, banner ads and menus.
For non programmers TypoScript is easier to work with than PHP. TypoScript also allows a single extension to be used differently on different pages without needing to alter the original PHP code or template files. An overview of TypoScript can be accessed here.
A TypoScript HTML Marker example:
<!-- ###FOO_BAR### START-->
<!-- ###FOO_BAR### END-->
TypoScript HTML markers extend template functionality by populating TYPO3 extensions and static data where ever that template is used. If you want to extend or remove the number of extensions that appear on each template you can do so by adding or removing the HTML TypoScript markers.
Creating markers can be fairly easy once you locate the TypoScript for that extension. Extension TypoScript is located in each extension folder.
Example:
Simple Banner Extension
The TypoScript for the Simple Banner extension is named ext_typoscript_setup.txt and ext_typoscript_constants.txt. In most cases look for setup.txt and constants.txt. Somtimes you may have to do a little digging to find it.
Visit the TYPO3 Extension Repository to find the location of Setup and Contants files which all listed on a single page with path information per extension. By default each extension is controlled by the TS values in files in Setup.txt and constants.txt. constants.txt contains specific values needed by setup.txt.
A new TypoScript HTML marker will look something like this (not tested).
subparts.MY_NEW_MARKER < plugin.tx_dedivbanner_pi1
subparts.MY_NEW_MARKER = TEXT
subparts.MY_NEW_MARKER {
AbsolutePath = {$SimpleBanner.AbsolutePath}
TitleAlt = {$SimpleBanner.TitleAlt}
CloseAlt = {$SimpleBanner.CloseAlt}
Style {
TableBgColor = {$SimpleBanner.Style.TableBgColor}
HeaderBgColor = {$SimpleBanner.Style.HeaderBgColor}
}
timeOut = {$SimpleBanner.timeOut}
rotateTitle = {$SimpleBanner.rotateTitle}
CMD = {$SimpleBanner.CMD}
pidList = {$SimpleBanner.pidList}
recursive = {$SimpleBanner.recursive}
left = {$SimpleBanner.left}
top = {$SimpleBanner.top}
{$SimpleBanner.AllowClose} AllowClose = 1
{$SimpleBanner.warning} warning = 1
{$SimpleBanner.NoLayer} NoLayer = 1
}
}
You can locate the default values found in the ext_typoscript_constants.txt file and use what you need like this.
#######################################
page.1 {
subparts.MY_NEW_MARKER < plugin.tx_dedivbanner_pi1
subparts.MY_NEW_MARKER = TEXT
subparts.MY_NEW_MARKER {
AbsolutePath = mybanner/file
TitleAlt = Some title
CloseAlt = Close
timeOut = 14000
rotateTitle = Another title
CMD = rotate
pidList = 22
}
}
Now you place the following TS HTML marker into 1column.html, 2column.html, 3column.html, etc. like this.
Another Example:
There are several ways to create TS markers including more advanced options. For these you will need to learn more TypoScript or do a Google search. This is an example of how to add Printlink to every page that using an image icon.
#######################################
print = PAGE
print.includeCSS {
file1 = fileadmin/templates/zmicro/css/ext/print.css
}
print {
typeNum = 98
bodyTag = <body onload="parent.self.print();">
10 = TEXT
20 < styles.content.get
}
page.1 {
subparts.PRINT < plugin.tx_cronprintlink_pi1
subparts.PRINT.linkContent = TEXT
subparts.PRINT.linkContent.value = <img<br /> src="fileadmin/templates/zmicro/images/printer.gif" alt="Printable version"
title="Printable version" height="12" width="16" border="0" style="border-width:0px;" />
}
Gregory Remington
Mediatech Consulting, Inc.
Phone : +1 (760) 525-1770 . Fax: +1 (760) 542-1990 . Skype: gremington