Hi community!
I’m trying to create a custom user macro for my org and I’d like the ability to display rendered HTML as a parameter for selection. The macro will basically be a custom button creator for end users. I’d like to have the ability for them to add an icon to the button based off of the icons available through AUI - Icons - AUI Documentation (atlassian.com)
How can I render those icons within a select/enum option for the custom user macro?
Hello fellow user macro enthusiast, @Matt ! Here is how I would do it. From that page you linked, pick out the icons you want. When you hover over the icon, it will display the type name.
Now use those names in whatever order you want (probably alphabetic would be best) to populate your param
## @param IconType:title=Type of icon|type=enum|enumValues=check,arrow-right-circle,camera-take-picture
<span class="aui-icon aui-icon-SIZE aui-iconfont-$paramIconType">Alternative Text</span>
The size you can also have as an option (I think default is small). I think the options are small and large.
If you wanted to be really fancy, you could come up with better names, then use a key-value structure to convert fancy name to machine name.
Thanks Bill for your response!
Rather than plain text for selecting the type of icon, I'd like have the user select from the rendered icon itself. I tried passing the params as the html string but that's not working. Maybe prevent to any type of RCE I'm assuming?
@param Icon:title=Button Icon|type=enum|enumValues=<span class="aui-icon aui-icon-small aui-iconfont-activity" original-title="activity">Activity</span>,<span class="aui-icon aui-icon-small aui-iconfont-add-circle" original-title="add-circle">Add</span>|required=false
I'm not sure if this is possible or if there's any way, within User Macros, to display/use JS/HTML as a method of input for the macro's parameters/option?
Is what I'm looking to do outside of the User Macro scope and more in the custom add-on area?
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it is outside the simple user macro. User should be able to select from the text pull-down, then refresh the view before insertion to see what it is.
There are more options available to you if you package a user macro as a plugin (basically the Velocity code is wrapped with normal plugin attributes. You do get more options (for example, being able to make the macro available on the Insert menu), but I am not sure you can change the display.
Information is here: user-macro-module Be advised that much of the info has not been updated in years.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Bill for confirming! Looks like I'll go with your original suggestion an only include the most useful options and inform users to use refresh to preview what it will look like. Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.