-
Type:
Suggestion
-
Resolution: Fixed
-
Component/s: None
Currently I can add a web-item to system.page to add a new tab (e.g. Translate). I have have that web-item link to my action and have the velocity output contain the following:
#applyDecorator("root")
#decoratorParam("helper" $action.helper)
#decoratorParam("mode" "translate")
#decoratorParam("context" "page")
The problem is that the page.vmd is hardwired to understand certain modes (view, edit, attachments, info) and it doesnt have a catch-all "else" to just dump the contents of $body out. It just drops the body out completely - a similar thing happens in the space.vmd too.
To make things worse, the "current" tab is selected based on matching $mode against the $item.key - so even if I surrender to rendering in page mode (and getting last edited by, favourites & comments - which I dont want) it means that the page tab will still be selected regardless!
The solution to this would be to take:
-
- ATTACHMENTS
#elseif ($mode == "view-attachments" || $mode == "move-attachments")
$body
#end
- ATTACHMENTS
and have
-
- ATTACHMENTS
#elseif ($mode == "view-attachments" || $mode == "move-attachments")
$body
- ATTACHMENTS
-
- CATCH ALL
#elseif
$body
#end
- CATCH ALL
Instead - do similar for space.vmd, but that needs both the $context and the various $mode if's in them having the catch all's applied. There may be other areas across the decorators which suffer the same limitation.
With this extension I can actually start to use web-item's for page and space tabs in plugins!