- Go to Browse > Confluence Admin > User Macros.
- The Create a User Macro section opens.
- Press the Create a User Macro button.
- Enter a name in the Macro Name text field. (Something like "pageid.")
- Enter a title in the Macro Title text field.
- Under the Definition of User Macro section, verify that the No macro body radio button is selected.
- Select HTML from the Output Format dropdown.
- Enter the following in the Template text box.
$content.getIdAsString()
- Press the Save button.
- Edit a Confluence page.
- In the area you wish to see the page ID, type:
{<macro_name>}
For example: {pageid}
Thursday, March 8, 2012
Show the Content ID of a Page
The following instructions are based on Jeremy Largman's instructions.
To view the content ID of a page, complete the following procedures. NOTE: you must be a Confluence admin to add a new user macro.
Page Unavailable, Can't Edit or Delete
This week I selected a page link in Confluence and received a server error. I could not view, edit or delete the page. I thought if I knew the page ID, I might be able to enter the appropriate edit URL. But I didn't know the page ID.
I looked around on the Internet and found Jeremy Largman's user macro, but I couldn't edit the page to add the macro. Finally, I found the correct procedures from Atlassian: Editing or Deleting a Page That Won't Render.
Page ID
Ultimately, I had to ask our admin to retrieve the page ID from the database. He was able to do so by running the following command against the database:
Edit URL
Once I had the page ID, I entered a URL similar to the following in my browser's address bar:
Delete URL
To delete the page, try:
Other Commands
Here are some other commands that may be useful.
I looked around on the Internet and found Jeremy Largman's user macro, but I couldn't edit the page to add the macro. Finally, I found the correct procedures from Atlassian: Editing or Deleting a Page That Won't Render.
Page ID
Ultimately, I had to ask our admin to retrieve the page ID from the database. He was able to do so by running the following command against the database:
select contentid from CONTENT where title = '<page_name>' and version = '1';
Edit URL
Once I had the page ID, I entered a URL similar to the following in my browser's address bar:
http://Other edit options include pressing the Ctrl + e keys or accessing the edit URL that includes the page name. For example:/pages/editpage.action?pageId=<page_ID>
http:///pages/editpage.action?spaceKey=<space_key>&title=<page_name>
Delete URL
To delete the page, try:
http://<base_url>/pages/removepage.action?pageId=<page_ID>
Other Commands
Here are some other commands that may be useful.
Edit blog post: |
http://<base_url>/pages/editblogpost.action?pageId=<page_ID> |
View attachment: |
http://<base_url>/pages/viewpageattachments.action?pageId=<page_ID> |
Delete attachment: |
http://<base_url>/pages/removeattachment.action?pageId=32787&fileName=harbour.jpg&version=1 |
Retrieve wiki markup from database: |
select body from bodycontent where contentid in (select contentid from CONTENT where title = '<page_name>'); |
Subscribe to:
Posts (Atom)