[Typo3] Usage of danp-docdir:HTML template

Kraft Bernhard kraftb at gmx.net
Tue Feb 15 20:42:44 CET 2005


Pierre wrote:
> Hi,
> 
> I'm looking for a way to use html template for this extension but i 
> can't find a template and in the code the only thig i've found about it 
> is :
> $this->conf['template']="###MODESELECTOR### ###DIRMENU### ###SEARCH### 
> ###BROWSETABLE### ###LISTING###";

If you want to know how to use HTML templates in your own extension:

do something like:
$this->htmltmpl = $this->cObj->fileResource($template_filename);
or
$this->htmltmpl = t3lib_div::getURL($template_filename)
(what you prefer)
then:
$this->subpart = $this->cObj->getSubpart($this->htmltmpl, '###SUBPART_MARKER###');
this retrieves everything between
<!-- ###SUBPART_MARKER begin -->
I am retrieved
<!--- ###SUBPART_MARKER end -->

Then you can do replacing on the subpart with the
$globalMarkerArray = array();
$globalMarkerArray['###field_1###'] = $value_field_1;
$globalMarkerArray['###field_2###'] = $value_field_2;
...
$globalMarkerArray['###field_n###'] = $value_field_n;
$this->replaced = $this->cObj->substitueMarkerArray($this->subpart, $globalMarkerArray);

but just see the functions in
tslib/class.tslib_content.php
on line 92


greets,
Bernhard
-- 
----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
----------------------------------------------------------------------



More information about the TYPO3-english mailing list