Handling duplicate page names
Asked by Jay A:

I have a requirement to have sub-pages within a space that have duplicate page names. Unfortunately, Confluence won't let me do that.

How are others handling this? Is there a way around it?

For example, I may have 2 top level pages which are named with a client name, and a sub-page under each one that I want to call "Findings and Recommendations". I know I could move this up to the Space level and keep a space for each client, however, I'm using the spaces for each team within the company. And because it doesn't allow nested spaces, this is the only way I can do it.


Answers:
author: brainbits GmbH
body: We had the same issue when adding "virtual empoyee folders" to our wiki. We wanted to build the following page structure:

```
Employee 1Personal DataContract DataTraining...Employee 2Personal DataContract DataTraining...Employee XPersonal DataContract DataTraining...
```

We solved it with dirty but - concering our special needs - very effective workaround: first we made the page names unique by adding employee-specific prefixes:

```
Employee 1Employee 1 - Personal DataEmployee 1 - Contract DataEmployee 1 - Training...Employee 2Employee 2 - Personal DataEmployee 2 - Contract DataEmployee 2 - Training...Employee XEmployee X - Personal DataEmployee X - Contract DataEmployee X - Training...
```

The we defined our own "tag" to mark the part of the page title that should not appear in the confluence frontend:

```
Employee 1[hide]Employee 1 - [/hide]Personal Data[hide]Employee 1 - [/hide]Contract Data[hide]Employee 1 - [/hide]Training...Employee 2[hide]Employee 2 - [/hide]Personal Data[hide]Employee 2 - [/hide]Contract Data[hide]Employee 2 - [/hide]Training...Employee X[hide]Employee X - [/hide]Personal Data[hide]Employee X - [/hide]Contract Data[hide]Employee X - [/hide]Training...
```

The rest is done by a little JavaScript-Magic, that is embedded via \*\*Confluence Admin \> Custom HTML\*\*:

```
(function() {            var expr = /\[hide\].*?\[\/hide\]/g,            blacklist = ['textarea', 'form', 'pre', 'script', 'style'];            $(document)            .ajaxSuccess(hideTextParts)            .on('ready', hideTextParts);            function isChildOfBlacklistedTag(node) {            while(node = node.parentNode) {                if (node.nodeType === Node.ELEMENT_NODE &amp;&amp; blacklist.indexOf(node.nodeName.toLowerCase()) &gt; -1) {                    return true;                }                        }            return false;        }                function hideTextParts() {            var root = document,                walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null, false),                node;                while (node = walker.nextNode()) {                console.info(node.parentNode);                if (expr.test(node.textContent) &amp;&amp; !isChildOfBlacklistedTag(node)) {                    node.textContent = node.textContent.replace(expr, " ");                }            };        }            })();
```

The blacklist ensures that the "tag" is not hidden where you need them to be shown. For example in the title field of the page editing screen. You may want to extend the list for your specific needs.

comments: author: mrsolo
body: I see three sections in Custom HTML, and the script shown is just displayed in the page. Can you please elaborate. I'm new to confluence and scripting


author: Jack [AppFox]
body: You just need to wrap the script in \<script\>\</script\>.


author: Christian Botved Poulsen
body: Is this workaround still usable in Confluence 6.2.3 ?  
We have just tried and it did not seem to work.


author: Miroslav Kralik
body: It does not work for me neither in v5.10.8.


author: Petr Spiller
body: Hi, anybody had any success using the script in 6.4?


author: Rick Mellor
body: It looks like there was some copy/paste errors in brainbits' original post. Here's a working version using Confluence v5.8.8. Sorry for the lack of formatting. It's not working for me and I don't want to spend the time to figure it out.

\<script language="javascript"\>  
(function() {  
var expr = /\\\[hide\\\].\*?\\\[\\/hide\\\]/g;  
blacklist = \["textarea", "form", "pre", "script", "style"\];

$(document)  
.ajaxSuccess(hideTextParts)  
.on("ready", hideTextParts);

function isChildOfBlacklistedTag(node) {  
while(node = node.parentNode) {  
if (node.nodeType === Node.ELEMENT_NODE \&\& blacklist.indexOf(node.nodeName.toLowerCase()) \> -1) {  
return true;  
}  
}  
return false;  
}

function hideTextParts() {  
var root = document,  
walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null, false),  
node;

while (node = walker.nextNode()) {  
console.info(node.parentNode);  
if (expr.test(node.textContent) \&\& !isChildOfBlacklistedTag(node)) {  
node.textContent = node.textContent.replace(expr, " ");  
}  
};  
}  
})();  
\</script\>


author: SarahA
body: Hallo Jay

One option is to use the Scroll Versions add-on:

<https://marketplace.atlassian.com/plugins/com.k15t.scroll.scroll-versions>

It allows duplicate page names, as one of the plugin features.

Cheers, Sarah

comments: author: Thomas Schlegel
body: wow, a plugin that costs nearly half the price of confluence itself. Is this really necessary ? If I would buy all the plugins to get the functionality I would expect from Atlassian, I would have to pay a real big amount of money. Where will all this lead to ?


author: Stefan Kleineikenscheidt _K15t_
body: Thomas, Scroll Versions is not only about duplicate page titles at all. Instead it truns Confluence into a full-fledged solution for wiki-based documentation, with many more features like version management, publishing to other spaces, managed content reuse, etc. (have a look at the screencasts here: [http://www.k15t.com/software/scroll-versions/overview](http://www.k15t.com/software/scroll-versions/overview)))

Compared with other documentation solutions the price is rather inexpensive - at least that's what we hear from most of our customers who transition to Confluence+Scroll Versions for documentation.

Cheers,  
-Stefan


author: Jay A
body: Does it really allow duplicate page names? Or does it only allow duplicate page names if they are in different versions?

I see it has some enhanced content reuse features, which is interesting. However, it still doesn't have what I need. I need two things right now:

1. Ability to have duplicate page names within a space. It does NOT have to be at the same tree level under the same parent page. It's not clear in the video or documentation if this is possible without doing a bunch of unneccesary version control voodoo.

2. The ability to include content, but when including it, basically have it paste into my document so I can modify it to be unique for the particular document I'm working on. My reusable content is essentially templates that I fill in with information. If there's a better way to do this, then I'm all ears.


author: Marcelino Richarte
body: Hey all, we also new to confluence, and sorry to dig up an old post... but is there any setting anywhere to allow page name duplicates ? we have multiple clients and under the same Space we have a few sub entries that will always be the same, and i dont like adding in ClientName or a number before just for it to be unique ?

Thanks


author: Stephan Du Plessis
body: You can also enter a non-blank-space in the title (ALT + 255), worked for me.


author: kevingvand
body: I managed to solve this issue on a dirty way by making use of the invisible seperator: "?" (<https://codepoints.net/U+2063>). You will not be able to tell the difference, however the link will be changed from "/\<SPACE\>/\<PAGE\>" to "viewpage.action?pageId=XXXXXX". In my case this was not a problem.


author: Sergey Bondarev
body: I've added spaces in pages with multiple words =) it displayed as one space, but have different names and links. It looks crazy,but works.


author: Ben J.
body: Are there any new answers for this question? I'm have the same request but slightly different context:

I want to create a Release Notes space that contains release notes for each release.

I want to use the same topic/page names for each release, for example, Bug Fixes, What's New, and so on.

I want to search only Release Notes across multiple releases.

Are there other answers or solutions to this problem besides what has been described so far under this question?


author: Thomas Schlegel
body: Hi Jay,

I think there will be no other solution than renaming the pages to "Findings and Recommendations for Client A", "Findings and Recommendations for Client B" etc.

Atlassian stated [here](https://jira.atlassian.com/browse/CONF-2524)that they will not change this behaviour.

Cheers

Thomas