The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Content by Label - Replace Text in Link Text

Deleted user
May 20, 2020

I am using the Content by Label macro and need to remove some text from the link that displays. For instance, there is page named "BMX - How to Replace Cranks" that has a label of "how_to" that is referenced in the macro. When the link renders, I would like for it to read "How to Replace Cranks" rather than "BMX - How to Replace Cranks".

 

How do I remove "BMX - " from the link text without having to modify the original page title?

 

Thanks!

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Matt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 20, 2020

If this is for Confluence Server one possible (hacky) way of doing this would be to use JavaScript in the custom Header section.  

If you use jQuery you can do a quick search and replace on the Content By Label items. Something like this:

$('.content-by-label li').each(function(k,v) {
var l = $(v).find($('div.details a'))
var t = l.text().replace('BMX - ', '');
l.text(t);
});
TAGS
AUG Leaders

Atlassian Community Events