[TYPO3-mvc] Extension spread over several pages - best practice?
Bastian Waidelich
bastian at typo3.org
Mon May 10 05:10:28 CEST 2010
Stefan Wild wrote:
Hi Stefan,
> how do I tell the linkViewHelper where to link? I
> know of the pageUid parameter, but hard-coding pageuids there doesn't
> seem to be a good solution.
you're right, hard-coding the target PID in the template would be bad. A
common approach in TYPO3 is to create TypoScript settings for the
respective PIDs. For the ease of use you might want to add TS constants
for those as well:
// TS CONSTANTS
plugin.tx_yourext {
settings {
# cat=plugin.tx_yourext/links; type=int+; label=Page id of the news
list page
newsListPID =
# cat=plugin.tx_yourext/links; type=int+; label=Page id of the news
details page
newsDetailsPID =
}
}
// TS SETUP
plugin.tx_yourext {
settings {
newsListPID = {$plugin.tx_yourext.settings.newsListPID}
newsDetailsPID = {$plugin.tx_yourext.settings.newsDetailsPID}
}
}
..and in your Fluid template:
<f:link.action action="foo" controller="Bar" arguments="{article:
article}" pageUid="{settings.newsDetailsPID}">show details</f:link.action>
HTH,
Bastian
More information about the TYPO3-project-typo3v4mvc
mailing list