Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there a way to refer to content id dynamically?

Maciej Kopa September 12, 2022

Hi,

Let me explain. I have a page and I want to refer to this current page id in the text, but automatically. Let's say I write:

This page id is ${contentid}. 

 And the output in confluence when I publish is:

This page id is 12312312.

 

1 answer

0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2022

Hi @Maciej Kopa , so I am guessing Anchors do not work for you?

Maciej Kopa September 12, 2022

Hi, not really. It has to be only substituted. I'm using API to create a page with specific content, and it contains reference to current page that has to be changed. I found a workaround that created more problems for me - I have tried to create page, then fetch it (get id), substitute the "${pageid}" with actual page id, and update the page. Unfortunately, next time I run my app it automatically updates all pages that are different (and the ground truth is what I have on my local machine) therefore it changes the actual page id back to "${pageid}".  Also updating the file on my local machine is not an option, at least for now. Maybe you got any other idea worth trying?

Maciej Kopa September 12, 2022

Or maybe you know how to insert Markdown image without speechifying the current page id?

![](/wiki/download/attachments/<pageid>/image.png)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events