[TYPO3-mvc] Extension spread over several pages - best practice?
Alex Bailey
vile at planet-generals.de
Fri May 7 09:58:55 CEST 2010
Am 5/6/10 12:02 PM, schrieb Stefan Wild:
> Hey,
>
> progress is made on my project thanks to your help. I have a more
> general question now. The extbase extension I am building is spread over
> several pages in the page-tree, with the navigation being built by
> regular TypoScript and only content filled in by the extension.
>
> What is the best approach in this case to tell the extension which
> controller/action to start based from which page it is called (I've seen
> some development with "switchableControllerAction" there!?). Also, based
> on this situation, 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.
>
> Best regards,
> Stefan
Ive worked on several "spread over pages" extensions and always went
good with the switchablecontrolleractions in flexform. Goes something
like this:
<switchableControllerActions>
<TCEforms>
<label>*Yourlabel*</label>
<onChange>reload</onChange>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Page1</numIndex>
<numIndex index="1">
yourController->index;yourController->action2;yourController->action 3
</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Page1</numIndex>
<numIndex index="1">
yourController->action2;yourController->index;yourController->action 3
</numIndex>
</items>
<maxitems>1</maxitems>
<size>1</size>
</config>
</TCEforms>
</switchableControllerActions>
You define a select in the flexform which contains the action you want
to call on this page, the first action in the list is the one which will
be called. (Important you have to define all actions you want to access
on this page too for example: If you index links to a "addAction" you
have to say myController->index; myController->add in the values)
Hope this helps you abit.
Best Regards
Alex
More information about the TYPO3-project-typo3v4mvc
mailing list