Can I reuse text (product name) in the title of pages?
Asked by Eva Mayrhofer:

Hello,

I am using Confluence to write technical documentation for our products. When I need to write the product name in the body of the pages, I am using the macro "Include+" of Scroll Versions (a plugin for Confluence). When the product name changes (this happens sometimes), I just change the product name once and all usages are updated.

However, it is not possible to use macros for the title of pages. The manufacturer k15t of Scroll Versions has confirmed that this is an Atlassian restriction as it is a plain text field.

So I have to either use a general expression (instead of the product name) in the page titles or I have to update all page titles where I have written the actual product name.

The second possibility (to write the actual product name) would be fine as long as it is possible to quickly replace certain expressions (such as a product name) in Confluence articles.

Does somebody have any ideas?

Cheers, Eva


Answers:
author: Tiago Comasseto
body: Hi Eva, this is not a very elegant alternative and a bit dangerous if not using carefully, but you could update the title of multiple pages at once directly via database.

You can use the following query as an example:

```
UPDATE CONTENT   SET TITLE = REPLACE(TITLE,'&lt;old_title&gt;','&lt;new_title&gt;');
```

* \<old_title\>: string to search on the field TITLE, which will be replaced for '\<new_title\>';
* \<new_title\>: string which will replace '\<old_title\>';

It would also require Confluence restart and possibly re-index.

Cheers

comments: author: Eva Mayrhofer
body: Hi Tiago,thanks for you tip. I will keep it in mind.Just a short question: Is it necessary to have the full title in the query?Or is it possible to use wildcards? For instance, {{SET TITLE = REPLACE(TITLE,'\*xyz\*',\*abc\*');}} would replace the expression "xyz" in all page titles that contains "xyz".Cheers,Eva


author: Tiago Comasseto
body: Hi Eva, you can use just part of the title. For example, if you have two pages, one with title **A123** and another with title **B123** , the following update with change both to **A321** and **B321** respectively.

```
UPDATE CONTENT   SET TITLE = REPLACE(TITLE,'123','321');
```

Cheers


author: Eva Mayrhofer
body: Thanks, that's good to hear.


author: Kirstin Seidel-Gebert
body: Thanks, Eva, for your detailed explanations.It would be interesting to meet other users on a sort of technical documentation/Scroll Versions gathering. :)LG Kirstin


author: Eva Mayrhofer
body: Hi Kirstin,let me detail how I am using the include+ macro regarding the product name:We have just one product (= the main product). So I have just one page with the product name. Let's call this page: PRODBut we have different variants of the product. So I have one page for each variant as well. Let's call these pages: VAR1 and VAR2 (for 2 variants)The pages VAR1 and VAR2 are using the include+ macro and it links to page PROD. The name of the respective variant is written after the include+ macro.The descriptions valid for variant 1 are using the include+ macro and it links to page VAR1. So the description mentions the product name and the name of the variant 1.The descriptions valid for variant 2 are using the include+ macro and it links to page VAR2. So the description mentions the product name and the name of the variant 2.When the product name changed (the name of the variants remained the same), I just had to change the content of the page PROD.All descriptions that mentioned the product name (because of the include+ macro) were updated as expected. I did not have to change the content of VAR1 and VAR2.Also: I am having an internal space that contains all sources of the descriptions. When a new version of the product is released, I publish the description to a new space that can be accessed by anyone (I am using Scroll Versions for this publish process). It is possible to change the product name in the published space at any time as well. This is rather handy for us.I hope this explanation helps. If not, let me know.Cheers,Eva


author: Kirstin Seidel-Gebert
body: Hallo Eva,I found it interesting that you're using the include+ macro to manage the product names in your documentation.We've also Scroll Versions installed but for a similar use case I'm using the Multi-Excerpt-Plugin.Did you create one page for every product to contain the name and then include this page with include+ to all pages the product name is used on?You can answer me via pm if you like (kgebert at e2e dot ch).Cheers,Kirstin


Tags: confluence-administration