It is possible to change the color of a page title automatically after a predefined period of time?

catalin.saizu October 18, 2019

Hello, 

I would like to check if there is a possibility to change the color of a page title automatically after a period of time. (I want to make this, part of a review process for expired documents and the only things that I can think of is the changing of the color page after 1 year - expiration date of the page/article)

Is this possible? Has anyone done this? 

Confluence version: 

Confluence 6.14.2
Thank you!

2 answers

0 votes
Dominic Lagger
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 Leaders.
October 18, 2019

Hi @catalin.saizu 

There is one possibility to do that. You could write a javascript, which scrape the page to find the last modified date. Then this date you could compare with today, and if the date is more than 1 year ago, you just have to set the color of the title to red. 

This means, that you won't be able to get all old pages, but you directly see it on the page itself. You can paste this code on the custom html (At end of the BODY) in the admin console. 

<script>


var lastmodifiedDate = new Date(document.querySelector('.last-modified').text);
var today = Date.now();

var difference = today-lastmodifiedDate.getTime();
if(difference >= 31556952000){
document.querySelector('#title-text').children[0].style.color = 'red';
}


</script>

Hope this helps

Regards

Dominic

catalin.saizu October 20, 2019

Hello Dominic, 

I will take some time to check this method. 

Thank you!

0 votes
Nicolai Sibler
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 Leaders.
October 18, 2019

Hi Catalin,

you can't do this with Confluence's out-of-the-box means and I don't think that there is some customization to do it. (I think that the color shouldn't just appear when viewing the page, but also in the sidebar, macro outputs and so on... And even if you achieved this, you'd still miss an overview of the outdated pages.)

Did you have a look at the Marketplace? Maybe you'll find something that fits your requirememt there...

 

Best regards,

Nicolai

catalin.saizu October 20, 2019

Hello Nicolai, 

Yes there is something on Marketplace, Comala Workflow, we are waiting for the pugin but it will take some time ... and meantime I need a solution for this. 

Thank you!

Like Nicolai Sibler likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events