Similar to this old post I am trying to improve the look of a page by using images as buttons. When I generate a button via the 'create from template' macro and then take the URL is has and insert it as the URL for an image, it doesn't work. When I then click the image, it just takes me back to the dashboard of the Confluence instance I am using. The original button works fine when I click it though.
The URL the button generate looks like this: http://example.com:8080/?createDialogSpaceKey=SBV2&createDialogBlueprintId=XXXX-XXXXX-XXXX
You could create a user macro to wrap your "create from template" button to override the styles on it.
Macro Body Processing:Rendered
Template:
## Developed by: Davin Studer ## Date created: 07/15/2015 ## @param Image:title=Image URL|type=string|required=true|desc=The URL to the image. ## @param Width:title=Image Width|type=string|required=true|desc=The width of the image in px. (ex. 98) ## @param Height:title=Image Height|type=string|required=true|desc=The height of the image in px. (ex. 98) #set( $id = $action.dateFormatter.calendar.timeInMillis ) <span id="button${id}">${body}</span> <style> #button${id} .aui-button.create-from-template-button, #button${id} .aui-button.create-from-template-button:active, #button${id} .aui-button.create-from-template-button:focus { background: url('${paramImage}') no-repeat; border: 0; text-indent: -999em; width: ${paramWidth}px; height: ${paramHeight}px; box-shadow: none; border-radius: 0; } </style>
Update: Added screenshot
image2015-7-15 16:28:44.png
Thanks for the suggestion. Would this work if I have multiple buttons on the same page? If it's not too much trouble could you expand on how I would apply this as I am pretty fresh to Confluence.
It should work just fine with multiple create from template button ... although I have not tried it. You just need to create a user macro (Confluence Admin -> User Macros) and use the above code. Then put the user macro on the page, fill in the macro parameters, and put your create from template macro inside it. See the above screen shot that I have added.
Awesome! Works great, thanks heaps for throwing that together. Any tips on how I can get the buttons side by side with a small gap between them? At the moment your wrapper macro takes up an entire line and when the page saves the buttons are all on top of each other. I've tried leaving no gap and not putting a space but no dice.
It looks like you're new here. Sign in or register to get started.