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

Add a macro button in the WYSIWYG allowing to insert from a configurable list of macros

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0 B2
    • Component/s: None
    • Labels:
      None
    • Similar issues:

      Description

      2/ Add a macro button in the WYSIWYG allowing to insert from a configurable list of macros (this list would come from the preferences field macros_mapping.
      You can see the test for macro mapping here:
      http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/xwiki/xwiki/trunk/src/test/java/com/xpn/xwiki/test/MacroMappingRenderTest.java?view=auto&rev=943

      For example

      In macros_mapping put:

      hello=velocity:hello4:first_name,last_name
      sign=velocity:sign:user

      In XWiki.VelocityMacros put

      #macro(hello $first_name $last_name)
      Hello $name
      #end

      #macro(sign $user)
      Signature by $user
      #end

      Then in the WYSIWYG Interface you should have a button to insert a Macro. This button should popup a window allowing to choose which macro.
      The window should show "hello" and "sign". When you choose "sign" then the popup should ask you to fill in first_name and last_name.
      When you click ok the following text should be included in the document

      {sign:first_name=ludovic|last_name=dubost}

      If you click inside this macro and click again on the macro button you should have the form for this macro pre-filled.

        Attachments

          Activity

            People

            • Assignee:
              phunghainam Phung Hai Nam
              Reporter:
              ludovic Ludovic Dubost
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: