I am working on a Content Element which displays Text over Image.
It works fine except one feature. The Image is not resized.
Here is my Code. Probalbly I missed the compile function. How can I make it work?
Code:
$GLOBALS['TL_DCA']['tl_content']['palettes']['imagetextfusion'] = '{type_legend},type;{Ueberschrift & Text}, headline, text;{image_legend},singleSRC, size;';
/**
* Fields
*/
$GLOBALS['TL_DCA']['tl_content']['fields']['headline'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['headline'],
'inputType' => 'text',
'eval' => array('mandatory'=>false, 'maxlength'=>255)
);
$GLOBALS['TL_DCA']['tl_content']['fields']['text'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['text'],
'inputType' => 'textarea',
'eval' => array('mandatory'=>false, 'maxlength'=>455)
);
class ContentImageTextFusion extends ContentElement
{
/**
* Template
* @var string
*/
protected $strTemplate = 'ce_imagetextfusion';
/**
* Generate module
*/
protected function compile() {
$this->Template = new FrontendTemplate("ce_imagetextfusion");
$this->Template->id = $this->id;
$this->Template->headline = $this->headline;
$this->Template->text = $this->text;
$this->Template->singleSRC = $this->singleSRC;
}
}
Bookmarks