Hi.
I'm trying to create one very simple ContentElement. I've been looking around the web for all kind of tutorials for the past few days but it still doesn't work... When I select the element in the backend, there are no fields being displayed where I could enter the data. All the ContentElement should do is to take one string, namely some latex-code. Client-side it will be rendered by JavaScript. I suppose that I have forgotten something but I really don't know what...
So, here the file structure of my module:
/config/config.php
/dca/tl_content.php
/templates/ce_renderer.tpl
/ContentLatexRenderer.php
And here are the contents of the files:
/config/config.php
Code:
<?php
array_insert( $GLOBALS['TL_CTE']['texts'], 0, array( 'LatexCode' => 'ContentLatexRenderer' ) );
?>
/dca/tl_content.php
Code:
<?php
$GLOBALS['TL_DCA']['tl_content']['palettes']['LatexCode']='{title_legend}code;{expert_legend:hide},space,cssID';
?>
/templates/ce_renderer.tpl
Code:
<?php echo $this->code; ?>
/ContentLatexRenderer.php
Code:
<?php
class ContentLatexRenderer extends ContentElement
{
protected $strTemplate = 'ce_renderer';
protected $code;
protected function compile()
{
$this->Template->code = 'hello world';
}
}
?>
Why don't I see any fields in the backend? And: How do I make the entered data be accessible by the variable $code?
Thanks in advance!
EDIT: dunno what it took so long for this topic to approve but meanwhile I already solved it on my own
Bookmarks