Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Mandatory labels in Confluence

Hi,

Is there an option to ensure a label must be entered into the editor with confluence 5.2?

I have read other articles and there does not appear to be any concrete solution to this.

We can instruct users to fill out the label field but it would be nice if they could not save until atleast 1 is entered.

Thank you!

2 answers

1 accepted

0 votes
Answer accepted

One of our developers put the following into the theme javascript file:

Hope this helps someone else.

$(document).on("click", "#rte-button-publish", function(e) {
            var labelbutton = $("#rte-button-labels");
            if($(labelbutton).length > 0)
            {
                if($(labelbutton).find(".trigger-text").text() == "Labels")
                {
                    e.preventDefault();
                    e.stopPropagation();
                    alert("Page requires at least one or more labels");
                }
            }
        });

/* CSS to not let last label be removed */
.aui-label.aui-label-closeable:last-child:first-child {
    padding-right: 5px;
    position: relative;
}

.aui-label.aui-label-closeable:last-child:first-child .aui-label-split-close {
    display: none;
}


This is what I am looking for

It would be great to know which file I need to edit 

Like PorschefanRoel likes this
0 votes
Davin Studer Community Leader Dec 04, 2013

Nope. No option for that. You could write a plugin for it, or maybe write a Speakeasy extension for it.

Thanks Davin.

Anybody have code samples for this?

Hi. Could the above css be extended to remove the 'x' for labels containing a certain value? Thanks.

Davin Studer Community Leader Nov 12, 2014

Not with just CSS no. You would need to use JavaScript for that. With CSS 4 you could do it, but nothing supports CSS 4 yet.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

⚡️NEW Group for Confluence Cloud Admins

Calling all Confluence Cloud Admins!  We created a new Community Group to support your unique needs as Confluence admins. This is a group where you can ask questions, access resou...

93 views 2 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you