Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13801

In the Create step, provide a request parameter in order to preselect the Page Template

Details

    • Unknown

    Description

      By default, we have the "Blank page" template pre-selected.

      It would be nice to provide a parameter in order to change the default selection to another template.

      The main use case is to allow applications that provide template providers for their entities to reuse the Create step and help the user by preselecting the template.

      Another use case would be to change the default template selection depending on the location the Create step is requested (a.k.a the place where the user clicks on create could affect the location and template properties). This behavior could be implemented because since XWIKI-8759 we have more clearer "creation restrictions" for templates.

      Attachments

        1. preselectedTemplate.png
          73 kB
          Ecaterina Moraru (Valica)
        2. templateParam.png
          55 kB
          Ecaterina Moraru (Valica)

        Issue Links

          Activity

            [XWIKI-13801] In the Create step, provide a request parameter in order to preselect the Page Template
            mflorea Marius Dumitru Florea added a comment - The type parameter was added in XWIKI-12332 with https://github.com/xwiki/xwiki-platform/commit/82e96fec99dd9d4e62dbaccfea3d64e01ea2b66c#diff-8fbb6a3d886107707e058169e783d3e6R128 .

            See https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-web/src/main/webapp/templates/createinline.vm#L191 . The following works fine for me:

            /xwiki/bin/create/Diagram/WebHome?type=Diagram.DiagramTemplateProvider
            
            mflorea Marius Dumitru Florea added a comment - See https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-web/src/main/webapp/templates/createinline.vm#L191 . The following works fine for me: /xwiki/bin/create/Diagram/WebHome?type=Diagram.DiagramTemplateProvider
            evalica Ecaterina Moraru (Valica) added a comment - - edited

            After talking with Eduard, apparently we have 2 params: template and templateprovider, that kind of already provide some of the requested functionality, but in a 'incomplete' manner.

            So for example, using this:

            will create the page using the requested template, but we also need to display visually to the user the preselection in the Templates displayer (which currently it disappears).
            Also displaying the preselection will help advanced users, that will be able to change the selection or location in case they want that.

            evalica Ecaterina Moraru (Valica) added a comment - - edited After talking with Eduard, apparently we have 2 params: template and templateprovider, that kind of already provide some of the requested functionality, but in a 'incomplete' manner. So for example, using this: will create the page using the requested template, but we also need to display visually to the user the preselection in the Templates displayer (which currently it disappears). Also displaying the preselection will help advanced users, that will be able to change the selection or location in case they want that.

            People

              mflorea Marius Dumitru Florea
              evalica Ecaterina Moraru (Valica)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: