Page and Space decorators need a catch all mode for $context and $mode

XMLWordPrintable

      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:

        1. ATTACHMENTS
          #elseif ($mode == "view-attachments" || $mode == "move-attachments")
          $body
          #end

      and have

        1. ATTACHMENTS
          #elseif ($mode == "view-attachments" || $mode == "move-attachments")
          $body
        1. CATCH ALL
          #elseif
          $body
          #end

      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!

              Assignee:
              Unassigned
              Reporter:
              Dan Hardiker
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: