[TYPO3-mvc] Render same template with different actions

J. Weber newsletter at jewe.net
Tue May 3 11:58:05 CEST 2011


Hi Franz,

thanks for answer and sorry the first point!
i tried

     $templatePathAndFilename = 
t3lib_div::getFileAbsFilename('typo3conf/ext/myExt/Resources/Private/Templates/Article/Index.html');

and

     $templatePathAndFilename = 
t3lib_extMgm::extPath('myExt').'Resources/Private/Templates/Article/Index.html';

as seen in other extensions, but i get "/No template was found./"
The file in $templatePathAndFilename exists in the local filesystem.

Other Ideas?

Thanks, Jens



Am 03.05.11 10:37, schrieb Franz Koch:
> Hey,
>
> first, don't hijack threads. You seem to have replied to a existing 
> thread instead of writing a new one, so your posting will be somewhat 
> hidden inside that other topic.
>
>> i would like to render the same index.html-template in different 
>> actions.
>> If i try
>> $this->view->setTemplatePathAndFilename("article/index.html");
>> i get "/No template was found./"
>> Same with:
>> $this->view->setTemplatePathAndFilename("Resources/Private/Templates/article/index.html"); 
>>
>
> Second: folders and filenames usually start uppercase, so it should be 
> Article/Index.html.
>
> Third: you probably have to pass the absolute file path there:
> ...->setTemplatePathAndFilename( t3lib_div::getFileAbsFilename(...) );
>
>
> Ever thought about using partials for this? Simply refer to a partial 
> from within each template - that's what they are for (using the same 
> rendering logic from several places).
>



More information about the TYPO3-project-typo3v4mvc mailing list