Hello, I’m looking for a way to automatically change the look of spaces that are set to Archived. I have trouble finding any useful methods in Groovy for that.
Any of the following would be nice =>
- Change the header/footer of the space via “look and feel” settings
- Change the Style sheet
- Some kind of watermark?
I’d like it to be obvious for someone that is following a link to an archived space to understand that they are looking at old information and that the links need to get updated.
Any sugestions ?
Hi Hans,
take a look at provided example scripts in Fragments section of ScriptRunner for Confluence. I’ve modified example script named: Add a banner for only a certain group to see
You need to create Fragment type:Show a web panel
Location: atl.confluence.header
key: group-banner-pane
Menu text: Example Banner
Weight: 1
Condition script:
return context.space.getKey() in ["SPACEKEY"]
// update SPACEKEY wit ket of archived space.
Provider/classscript use the following code
import com.onresolve.scriptrunner.canned.util.OutputFormatter
writer.write(
OutputFormatter.markupBuilder {
div(style: 'display: flex; justify-content: center; font-size: 20px; background: yellow;') {
a(href: 'https://kb_article_what_does_archived_space_means', target: '_blank', 'Archived Space')
}
}
)
on attempt to see space with key SPACEKEY, scriptrunner will generate Yellow banner on the top of the page.
Hope this helps.