[TYPO3-mvc] Render same template with different actions
Franz Koch
typo3.RemoveForMessage at elements-net.de
Tue May 3 10:37:02 CEST 2011
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).
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list