How to modify Confluence to allow duplicate page titles [closed]
Asked Answered
T

5

8

I'm using Confluence for documentation, both end user documentation and internal development documentation.

The problem with Confluence is that it doesn't allow duplicate page titles, since the URL consists of only the title and not the whole tree structure.

Is there any way to alter this behaviour?

There is a plugin which does this, and much more. The "much more" part is the problem, because that plug-in is quite expensive, especially if only one of many features will be used (https://marketplace.atlassian.com/plugins/com.k15t.scroll.scroll-versions).

Twoseater answered 9/1, 2014 at 12:55 Comment(6)
Do you really need to have the same page names? Links can have whatever text you want, having unique page names can't be a big issue.Redcoat
I would say yes. A good example is the area where customer information is to be documented. The structure would be like: Customer Name > Agreements Customer Name > Contact Information In this case, only one page can be names "Agreements" in the whole customer space.Twoseater
Can you give more examples of where a duplicate name would be required?Grate
@underverse "Introduction" is a common one. Where you've got a project "foo" and project "bar" in the same space, and you want an introduction page to each of them. Now you have to call them Foo Introduction and Bar Introduction, which violates DRY and the Smurf principle.Paripinnate
@ragerdl So far as I can tell it would only be a violation of the Don't Repeat Yourself Principle if the content was substantially the same on both pages. Given that Foo and Bar are different projects, possibly with different project managers, different goals, time frames, etc, then yes two different pages named differently would be needed. I have no idea what the smurf principle is - link please.Grate
@underverse, indeed, I'm considering the hierarchy of the page to be part of the name. E.g., if you look at the page tree view, you'll have "Foo -> Foo Introduction". Smurf is just another version of DRY, but you can see #21 here: blog.codinghorror.com/new-programming-jargonParipinnate
S
2

Atlasian has stated that they won't change this behavior. There are plugins like Scroll Versions to work around that, but you might want to rethink your wiki structure there.

Does Wikipedia allow multiple pages with the same name? It doesn't. If you get rid of the thought of a hierarchical ordering for your wiki and instead start using the search function and tags, it all makes sense.

We had the same discussion when setting up documentation for our projects. What if you have >150 pages named "Documentation"? Try searching in that if you don't know the exact product name.

Seavir answered 29/1, 2014 at 12:8 Comment(4)
FYI ... The "plugins" link above will bring you to the "Scroll Versions" Add-On which is $300Satterwhite
If you find a free version that does the name, feel free to link it. Nobody said it was for free ;). And it costs way more, the bigger your license is.Seavir
I think you've suggested a good Add-on that provides the requested functionality, and thought I'd simply add info just in case the link breaks. If I ever find a free one then I'll certainly note it :)Satterwhite
Good point there. I edited my post to tell people where they will jump to.Seavir
I
13

We had the same issue when adding "virtual empoyee folders" to our wiki. We wanted to biuld the following page structure:

Employee 1
 Personal Data
 Contract Data
 Training
 ...
Employee 2
 Personal Data
 Contract Data
 Training
 ...
Employee X
 Personal Data
 Contract Data
 Training
 ...

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

Employee 1
 Employee 1 - Personal Data
 Employee 1 - Contract Data
 Employee 1 - Training
 ...
Employee 2
 Employee 2 - Personal Data
 Employee 2 - Contract Data
 Employee 2 - Training
 ...
Employee X
 Employee X - Personal Data
 Employee X - Contract Data
 Employee 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:

<script>(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>

The blacklist ensures that the "tag" is not hidden where you need them to be shown. For example in the title field ofthe editing screen of a page and within the CSS-editing field in the space administration. You may want to extend to

Inge answered 4/3, 2015 at 16:24 Comment(0)
V
3

I realize this is a bit late, but for anyone else looking for this, my solution doesn't require any javascript trickery or special plugins, just an invisible ascii code.

I add ASCII character 255 to the end of my title (or more than one if needed). It appears as whitespace so it doesn't show up in the title. This is only a valid option if you don't care to have the title as part of the URL as Confluence will link to the page by pageId (i.e. https://confluence.yourcompany.com/pages/viewpage.action?pageId=44335161).

If you don't know how to do an ASCII code, just hold down the Alt key while typing 255 on the number pad (or any other ASCII code).

Vassaux answered 24/7, 2018 at 21:30 Comment(0)
S
2

Atlasian has stated that they won't change this behavior. There are plugins like Scroll Versions to work around that, but you might want to rethink your wiki structure there.

Does Wikipedia allow multiple pages with the same name? It doesn't. If you get rid of the thought of a hierarchical ordering for your wiki and instead start using the search function and tags, it all makes sense.

We had the same discussion when setting up documentation for our projects. What if you have >150 pages named "Documentation"? Try searching in that if you don't know the exact product name.

Seavir answered 29/1, 2014 at 12:8 Comment(4)
FYI ... The "plugins" link above will bring you to the "Scroll Versions" Add-On which is $300Satterwhite
If you find a free version that does the name, feel free to link it. Nobody said it was for free ;). And it costs way more, the bigger your license is.Seavir
I think you've suggested a good Add-on that provides the requested functionality, and thought I'd simply add info just in case the link breaks. If I ever find a free one then I'll certainly note it :)Satterwhite
Good point there. I edited my post to tell people where they will jump to.Seavir
N
1

Confluence isn't just a wiki system either as it seems to promote the use of a documentation hierarchy. A hypothetical example could be:

MongoDB 
    Installation
        Linux
        Windows
        Mac
    Security
    Data Model

I would love to keep the page title short rather than naming them like "MongoDB -> Installation -> Linux".

But if I just keep them short then all kinds of name collision happens between this and other documentation

Natalia answered 18/7, 2014 at 17:41 Comment(0)
C
1

My company had this problem too. The better way to handle this situation is to create one workspace for each "context". IMO, if you need to insert a prefix in every page you are creating, it seems a context demarcation. Therefore, it's better insert each context in its own Confluence space.

Dashboard - Space 1 - My Page
Dashboard - Space 2 - My Page

When you create spaces you are able to categorize them, therefor you can insert labels like "project", "database", "application", etc. https://confluence.atlassian.com/display/DOC/Using+Labels+to+Categorise+Spaces

Regards

Castigate answered 26/3, 2015 at 18:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.