Different types of titles and using the option “keep permalinks”
Hi,
a) What is the "permalink of the original language”? If it is the one I suppose, it is not transferred into the target space by using the option "keep permalink". Is this a bug described here: https://k15t.jira.com/browse/VSN-2832 ?
b) What get-methods can I use to display the different titles?
$content.getTitle() seems to fetch the permalink of the page (or in the master space the title of the dot-page)
How can I get the titles of the translated pages or the scroll page title?
Thanks,
Volker
-
Hi Volker,
Thanks for getting in touch.
The mentioned issue is referring to an unexpected behavior when using Scroll Translations and publishing all languages.
It would be great if you could share some further insights to question a) - Are you using Scroll Tranlsations at all, or is only Scroll Versions activated in that space? If also Scroll Translations is activated, did you publish a specific language, or all languages?
In the meantime I'll check further details internally regarding your second questions.
Best,
Nils -
Hi Volker,
regarding your second requirement, you can access the following information (please note that this is not officially supported, as we do not have an official REST API, see https://k15t.jira.com/browse/VSN-1811):
- Permalink (Confluence page title): $content.title
- Scroll page title: $svThemeHelper.getScrollPage($content).scrollPageTitle
- Scroll page title of original Language: $svThemeHelper.getScrollPage($content).originalPage.scrollPageTitleUnfortunately there's no way to get the page title of the translated page. The scrollPageTitle on a translated page always returns the page title of the currently selected language.
I hope this information helps nevertheless.
Best,
Nils -
Hi Nils,
thank You, this helps very much! Especially the ScrollPage title. And, sorry, I have forgot to tell You the details. We are using Scroll Versions with Scroll Translations and HTML Exporter. In the moment we only publish in German, but we plan to publish in four languages. Technically we have established all four languages in the master space and the target spaces. So, at first I have published all languages and now I publish only in German until we start to translate the other languages.
But besides from the languages I have expected by using the option "keep permalinks", that the permalinks from the pages of the master space overwrite the permalinks from the pages in the target space.
Greetings,
Volker
-
Hi Nils,
I don't think, it is necessary to make up a new post.
We are testing Con 6.13 with Scroll Version 3.14. As we are using macros with the scroll page title, we need methods to get the right title. The above code doesn't work anymore.
- Permalink (Confluence page title): $content.title
- Scroll page title: $svThemeHelper.getScrollPage($content).scrollPageTitle
- Scroll page title of original Language: $svThemeHelper.getScrollPage($content).originalPage.scrollPageTitleCould you tell us the updated code, please. Thanks!
Greetings
Volker
-
Hi Volker.
Could you please share where do you use $content.title? a user macro? exporter template?
$svThemeHelper has been removed a year ago when we removed the rest of the scroll versions theme. This change wasn't announced as it has never been an official API, and we didn't know that anyone was using it.
Roman.
-
Hi Roman,
this could be a workaround with $content.title. At the beginning I put this in the user macro:
#set ($stralt = $content.getTitle())
#set ($lenstralt = $stralt.length() - 12)
#set ($strneu = $stralt.substring(1, $lenstralt))Our version numbers have always the same length, so I can cut the SV-parts and then using $strneu.
But this is not a real solution, because it takes the permalink.
Do you have other suggestions?
Volker
-
Hi Volker,
unfortunately there is no equivalent workaround.
The ScrollPageTitle of a page is stored in a page property called "com.k15t.scroll.versions.scroll-page-title". In Java it is possible to get it by callingContentPropertyManager.getTextProperty(page, "com.k15t.scroll.versions.scroll-page-title").
So a possible workaround would be to write a small app which injects this logic into the velocity context.
Regards,
Peter
Please sign in to leave a comment.
Comments
8 comments