[TYPO3] Getting template file from flexforms

Christian Lerrahn christian.lerrahn at cerebrum.com.au
Fri Sep 21 02:35:16 CEST 2007


On Thu, 20 Sep 2007 10:55:21 +0300
"Dmitry Dulepov [typo3]" <dmitry at typo3.org> wrote:

> Christian Lerrahn wrote:
> > I'm trying to set a template file for my extension in the flexforms.
> > However, when I select a file or upload one specifically for the
> > plug-in, I end up with only the file name in
> > $this->cObj->data['pi_flexform'] but not the path. Now, as I don't
> > know if the file was directly uploaded in the plug-in configuration
> > or just included from somewhere in fileadmin/, I cannot predict
> > that path. How can I tell where that file is?
> 
> $templateFile =
> $this->pi_getFFvalue($this->cObj->data['pi_flexform'],
> 'field_templateFile'); $this->templateCode =
> $this->cObj->fileResource($templateFile);
> 
> And you get the whole template code.
> 

Doesn't seem to work for me. If I do this, I get no template while
everything works once I add the path. I actually checked the tt_news
code and there upload/tt_news/ gets prepended to the file name, too.
However, I don't like the idea of hard coding paths in my extension. :(

Cheers,
Christian


More information about the TYPO3-english mailing list