Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
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

Adding markup to all children of a page

We have a page where we store all the outdated pages.  We want to keep the pages around since they contain historical information.  The issue is that users can find these pages using search and not easily notice that they have been moved to the archived page tree.  Is there a way to change the parent page in this tree such that it would add some warning text to each child automatically?  I thought maybe I could change the Page Template or Page Layout for the page and have that apply to its children, but I was unable to find any way to do that (maybe it's possible and I don't have enough permissions to do that).

Ideas?

2 answers

0 votes
Brant Schroeder Community Leader Jun 08, 2021

@scott_gartner Welcome to the Atlassian Community

If you are using the archive feature they will not show up in search https://support.atlassian.com/confluence-cloud/docs/archive-pages/  This feature is available on all paid plans.  

There is no way to bulk update pages natively in Confluence other than the rest API.  So really your choices are listed below to bulk edit pages or change their template.

  1. Confluence REST API
  2. Plugin
  3. Update content manually
  4. Update code manually
  5. Export/edit/import

If you are on a free plan you can always use page permissions to hide the page from other users.

Brant,

Thanks for the response.  The pages are not archived, but they have all been moved under one specific page (sometimes whole trees of pages were moved).  The goal isn't to hide the pages, but instead to warn the user that the information is at least partially out of date.

I saw some other people talking about adding a macro to the Page Layout for the space, but the problem there is figuring out if the page is in the required part of the tree (that discussion involved changing all pages in the space, but I only want to modify some pages). 

I don't know if these macros they are talking about are running on the client (JavaScript) or the server (Velocity?), or if there is a way in either of these to walk up the current page's parentage tree to see if it needs the special markup.

Scott

Brant Schroeder Community Leader Jun 08, 2021

@scott_gartner 

Is there a need to keep them in the same space or could they be migrated to an archive space?

 If you could move them all to the same space then you could apply a macro to the page template and identify them as being archived.  Otherwise, you will need to touch each page individually to add it to the page or change the page template.

Brant,

Yeah, I was trying to avoid touching all the pages, there are quite a lot of them.  Plus it would be an ongoing problem as new pages are moved into that tree, someone would have to remember to apply any individual change.  That's why I was looking for a generic solution at the "space" level.

If we move them to their own space, they will stop coming up in search results for this space (to which they do actually belong, they are just old/deprecated).

Also, we do have archived pages in Confluence and the archived pages do still come up in the search results in that space.  Interestingly, pages that are archived all get a consistent banner on them.  I wonder how that is implemented in Confluence (maybe they created a special flag, which they can use to decide when to add the "archive" banner).

Thanks for the ideas though,

Scott

Hello Scott,

One possibility would be to use Power Scripts for Confluence to move pages using the movePage() routine or clonePageTree()

Regards,

Hyrum

Full disclosure, I a product engineer for Power Scripts and work for Anova Apps, an Appfire company.

Hyrum,

Thanks for the reply.  How would moving or cloning the pages do the job?  They would still not indicate that they were out of date.  The goal is to have an indication at the top of the page that the data on the page is old (without having to edit each and every page and remembering to edit any future pages).  They are where we want them to be in the space.

Scott

Hello Scott,

Please see this example script for adding a date at the top of the page:

number id = getPage("Demo", "Example Page");
%id%.content = "<p>" + currentDate() + "\n\n" + id.content + "</p>";

Here is what the page looks like:

Screen Shot 2021-06-08 at 8.13.33 PM.png

Here is documentation on the getPage() routine. Here is documentation on setting variables.

You may also be interested on Power Scripts' integration with Comala Workflows. Comala Workflows is really interesting in that you can create a workflow for pages (similar to a Jira issue workflow) that is useful for creating a cycle for pages and managing the process of archiving pages.

The idea here is that you could use Comala Workflows to manage the process that in turn would run a SIL script based on a workflow event.

Due to Confluence Cloud security features, you may need to open the documentation in incognito mode or by logging out of Confluence.

Regards,

Hyrum

Scott,

You can also move through the page tree starting at the parent. something like:

number parent = getPage("Demo", "Example Page");

number [] children = getChildPages(parent);

for(number childPage in children) {   

    %childPage%.content = "<p>" + currentDate() + "\n\n" +                                    childPage.content + "</p>";

}

Here is the documentation for getChildPages.

Another option is using CQL to find pages.

Regards,

Hyrum

Suggest an answer

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

Miss the Confluence demos at Team 21? Watch them here!

Phew, Atlassian Team 2021 blew by. With dozens of demos and a handful of keynotes, you may have missed some of the awesome Confluence Cloud sessions. Don't' worry, you can watch them all here or on Y...

299 views 2 6
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