Page 1 of 1

Add text in welcome page

Posted: Wed Jan 15, 2020 4:00 pm
by jmanier
Hi,

I was wondering if that was possible to add some text at the header of the welcome page. Is it? If yes, how can I do that? I can't find how.

See the picture below:

https://www.zupimages.net/viewer.php?id=20/03/3ric.png

Thanks!

Re: Add text in welcome page

Posted: Fri Jan 17, 2020 10:46 am
by alin
Hello,

You can use the "webhelp.fragment.welcome" HTML Fragment extension point.
You can find more information in our User Manual about Inserting Custom HTML content in the WebHelp Responsive output: https://www.oxygenxml.com/doc/versions/ ... -html.html

Regards,
Alin

Re: Add text in welcome page

Posted: Thu Jan 30, 2020 12:15 pm
by jmanier
Hello, thank you. It seems it's the right solution but it means I now need to use 2 different scenarios to get a version both for english and french languages. If there is any slution to get the translation into an only one scenario, I would be glad!

Thanks!

Re: Add text in welcome page

Posted: Thu Jan 30, 2020 4:25 pm
by alin
Hello,

Do you want the text you are inserting in the welcome page to be translated according to the current language of your publication?

Regards,
Alin

Re: Add text in welcome page

Posted: Fri Jan 31, 2020 5:10 pm
by jmanier
Hello,

Thanks for your answer.
Yes that's exactly what I want.

Regards,

Jeremy

Re: Add text in welcome page

Posted: Mon Feb 03, 2020 11:40 am
by alin
Hello,

You can achieve this by using the localization support from WebHelp. You should follow the procedure described here: https://www.oxygenxml.com/doc/versions/ ... aid-title2
and add a localization entry for your welcome message for both English and French.
The content of the webhelp-extension-strings.xml (step 3) file should look like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<langlist>
    <lang xml:lang="en" filename="strings-en-us.xml"/>
    <lang xml:lang="fr" filename="strings-fr-fr.xml"/>
</langlist>
The strings-fr-fr.xml file should look this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<strings xml:lang="fr-fr">
    <str name="my.welcome.message" js="true" php="false">Mon message de bienvenue</str>
</strings>
The content of the strings-en-us.xml file should be:

Code: Select all

<strings xml:lang="en-us">
    <str name="my.welcome.message" js="true" php="false">My Welcome Message</str>
</strings>


As you can see in the two translations files (strings-en-us.xml and strings-fr-fr.xml) your welcome message has the same localization key assigned to it (i.e.: my.welcome.message).

After you finish the above procedure and integrate your newly custom localization extension plugin (step 5), you can use the WebHelp Macros support inside your webhelp.fragment.welcome HTML Fragment File to have your message localized to the current language of your DITA Map.
The content of the webhelp.fragment.welcome HTML Fragment File should be:

Code: Select all

<div class="welcome" xmlns:whc="http://www.oxygenxml.com/webhelp/components">
    <whc:macro value="${i18n(my.welcome.message)}"/>
</div>
As you can see I have used the my.welcome.message localization key in the i18n() macro. If the root of your DITA map will have one of the following @xml:lang declarations, then the fragment will expand accordingly:
  • <map xml:lang="fr-fr">
  • <map xml:lang="en-us"> (this may be omitted as the default language is english)
Regards,
Alin

Re: Add text in welcome page

Posted: Mon Feb 03, 2020 12:33 pm
by jmanier
Hello,

Thanks for your help!! It's very clear!

Regards,

Jeremy