Create a Create Button User Macro

Hi there,

I’m a newbie in code, so I don’t know if what I write will be exactly relevant.

I want to create a User Macro in Confluence Server. I found on the net some buttons class that I added in confluence/admin/viewstylesheet.action and I want to use these classes in the macro.

Here are the correct code to include such a button : <a href="/" class="button button-color button-size button-shape">Link</a>

So I used three drop-down to chose which caracteristics to use. And here what I did :

## @param Lien:title=Lien|type=string
## @param Taille:title=Taille du bouton|type=enum|enumValues=minuscule,petit,normal,grand,géant,énorme
## @param Couleur:title=Couleur du bouton|type=enum|enumValues=gris,bleu,vert,orange,rouge,violet
## @param Forme:title=Forme du bouton|type=enum|enumValues=rectangle,rectangle adouci,rectangle arrondi,carré,carré adouci,rond

 #set( $taille = "")
 #set( $paramCouleur = "")
 #set( $paramForme = "")

#if( $paramTaille == "minuscule" )
 #set( $taille = " button-tiny ")
#elseif( $paramTaille == "petit" )
 #set( $taille = " button-small ")
#elseif( $paramTaille == "normal" )
 #set( $taille = " ")
#elseif( $paramTaille == "grand" )
 #set( $taille = " button-large ")
#elseif( $paramTaille == "géant" )
 #set( $taille = " button-jumbo ")
#elseif( $paramTaille == "énorme" )
 #set( $taille = " button-giant ")
#end

#if( $paramCouleur == "gris" )
 #set( $paramCouleur = " ")
#elseif( $paramCouleur == "bleu" )
 #set( $paramCouleur = "button-primary ")
#elseif( $paramCouleur == "vert" )
 #set( $paramCouleur = "button-action ")
#elseif( $paramCouleur == "orange" )
 #set( $paramCouleur = "button-highlight ")
#elseif( $paramCouleur == "rouge" )
 #set( $paramCouleur = "button-caution ")
#elseif( $paramCouleur == "violet" )
 #set( $paramCouleur = "button-royal ")
#end

#if( $paramForme == "rectangle" )
 #set( $paramForme = "")
#elseif( $paramForme == "rectangle adouci" )
 #set( $paramForme = "button-rounded")
#elseif( $paramForme == "rectangle arrondi" )
 #set( $paramForme = "button-pill")
#elseif( $paramForme == "carré" )
 #set( $paramForme = "button-square")
#elseif( $paramForme == "carré adouci" )
 #set( $paramForme = "button-box")
#elseif( $paramForme == "rond" )
 #set( $paramForme = "button-circle")
#end

<a href="$paramLien" class="button$taille$paramCouleur$paramForme">$body</a>

But it doesn’t work at all, and when I inspect the element, I find that :

<a class="external-link conf-macro output-inline" data-hasbody="true" data-macro-name="nice-button" href="link" rel="nofollow">link</a>

Can you help me ?