I have made a few user macro's in Confluence 3.3 and tested them in Confluence 4+.
The user macro's in Confluence 4 are all showed as block. I am aware of the fact that user macros with a body have the option in the RTE to set on a new line or at the same line, but that doesn't solve my problem.
My problem is that in combination with the create-page plugin we create in one click, pages based on templates, and on these templates we use te user macros. So everytime a new page is made based on a template a user should manually toggle the user macros to be on the same line...
I also read about a standard atlassian parameter for the output but it didn't help me solving the problem: http://community.customware.net/customware/topics/inline_text_following_a_macro
So my question is, can I set a default value for the outputtype in the user macro template, something like:
#set($macro.OutputType.INLINE)
or
#set($macro.getOutputType().INLINE)
or
#set($atlassian-macro-output-type=INLINE)
Community moderators have prevented the ability to post new answers.
I was able to overcome this problem by explicitly adding this parameter:
<parameter name="atlassian-macro-output-type" type="enum" required="true"> <value name="INLINE"/> </parameter>
to macro declaration in atlassian-plugin.xml
It starts to appear in Macro Browser of course, but user can't change it from there (as its a "required" single-valued enum param).
User can still change it from macro property-panel though...
It looks like there is currently no 'proper' way for a user macro with a body to default itself to be an inline macro. The only way to do it is for the user to highlight the macro in the editor and select the 'inline' option for each macro instance. :-(
This was raised as a feature request in Confluence, but was marked as resolved in Confluence 4.0 because of this user editing option. (see https://jira.atlassian.com/browse/CONF-15860). It's a shame that this was closed, because I think there should be some choice on the part of the macro author as to what the default behaviour of the macro should be.
As CharlesH above me suggests, you'll probably have to write some javascript/css to manipulate the DOM to give your macro the 'appearance' of being inline.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Joseph, indeed it seems like there is no 'proper' way for a user macro to default itself. And I agree there should be some choice for the author to set inline or block as default.
Thanks for the link to the feature request.
I also found this request (https://jira.atlassian.com/browse/CONF-24581)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Just want to follow up on this question, is there a way to use Velocity to set the default Output Type of a user macro to be BLOCK instead of INLINE?
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a current bug in the application and it is being tracked in CONF-22898.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.