I recently had a client ask for a ribbon button with fairly long label text – “Approve Job Request FOR ORDER”. And he really wanted the “FOR ORDER” to appear on its own line. I tried adding extra spaces in the label text to get the line to break where I wanted, but that didn’t work (and it’s pretty clunky anyway). So, how do you insert line breaks in button label text?
Firstly, whenever you are working with CRM Ribbon Customizations, I strongly suggest using Ribbon Workbench. “Why Ribbon Workbench is an awesome tool” is its own blog post, and not the subject of this one, but suffice it to say that it gets the solution to the problem of CRM Ribbon Customizations completely right.
So, I’ve got Ribbon Workbench open, and I’ve created the button with the label text:
But, if I just publish it this way, I don’t get the line break I want. In order to get the line break, I need to insert a special character, Zero Width Space, TWICE where I want the break to be – in this case between the words “Request” and “FOR”.
But how do I get the Zero Width Space? Open the Windows Character Map from the Start Menu
- Choose “Arial Unicode MS” as the font
- Scroll down until you reach the U+200B Zero Width Space. The characters are listed in hexadecimal order, so the character to the left will be U+200A and to the right will be U+200C. You can see the character labels change as you scroll in the bottom left corner of the Character Map
- Click the Zero Width Space so it is the prominent character on the screen, and the bottom left of the Character Map says “U+200B: Zero Width Space”
- Click the Select button TWICE – remember, you want two of them
- Click Copy. You should now have two Zero Width Space characters on the clipboard
Now, back to Ribbon Workbench. Just put your cursor where you want the line break to be and paste. It will look like nothing happened. Don’t worry about it – the characters are “zero width”. Just publish your customizations from the workbench, and you should have your line break.