Summary
This Confluence user macro adds the parent content ID (page ID) as a label to the current page.
Use Case
On several occcasions I received the requirement to add the parent page ID as a label to the (current) child page. This was helpful for certain plugins or simply needed as a relational link to the parent’s page topic.
Source Code
#* ============================================================================ * ADD PARENT ID AS LABEL * * This Confluence user macro adds the parent content ID (page ID) as a label * to the current page. * * Version: 1.0.002 * Date: 2016-11-17 * Author: George Lewe * Source: https://github.com/glewe/add-parent-id-as-label * License: GNU LGPLv3 * * Macro body: None * Body processing: None *# #* ---------------------------------------------------------------------------- * PARAMETERS *# ## @noparams #* ---------------------------------------------------------------------------- * INPUT *# #* ---------------------------------------------------------------------------- * OUTPUT *# #set($myLabel = ""+$content.parent.id) #set($success = ${content.labelUtil.addLabel($myLabel,$action.labelManager,$content)})