Page 1 of 1

Add title to <head> element in WebHelp

Posted: Thu Sep 21, 2017 2:15 pm
by ann.jensen
Hi,
I have just used the webhelp.fragment.head parameter to add a Title to my webhelp responsive output. I added

Code: Select all

<title>System Name</title>
to a HTML file and associated the file with webhelp.fragment.head
This works fine for index.html.
However, when I use the Search functionality it is appending System Name to all search results listed (with no space).
Is this as expected?
Thanks in advance,
Ann

Re: Add title to <head> element in WebHelp

Posted: Fri Sep 22, 2017 2:15 pm
by radu_pisoi
Hi,

I don't think this is an issue.

The webhelp.fragment.head fragment is used to inject custom HTML content into the head section. In your case, a <title>System Name</title> element will be injected in all generated HTML files. Please note that this custom title will duplicate the existing title generated from the topic's title.

On the other hand, the WebHelp search indexer will collect the topic title from html/title element. So, this is the reason why the custom title, System Name, is appended to all search items displayed in the search page.

Could you provide us more details about your use case? Maybe we can help you to find other solution.

Re: Add title to <head> element in WebHelp

Posted: Fri Sep 22, 2017 2:28 pm
by ann.jensen
Hi,
I guess I just want a Title for the landing page i.e. index.html.
Regards,
Ann

Re: Add title to <head> element in WebHelp

Posted: Mon Sep 25, 2017 10:35 am
by ann.jensen
Hi,
Just to clarify. I was trying to add a Title for the webhelp landing page i.e. Index.html along with a Favicon so that my initial browser tab is populated with icon and title.
This has a knock-on effect of the index page title being appended to each search result which I don't really want.
Is there any other way that I can achieve what I want?
Thanks in advance,
Ann

Re: Add title to <head> element in WebHelp

Posted: Mon Sep 25, 2017 10:50 am
by radu_pisoi
Hi,

To set a title for the main page it should be enough to specify a title in the DITA map. Something like:

Code: Select all

<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>A List of NASA Space Videos</title>
...
</map>
You can add a custom favicon to your WebHelp system by simply using the webhelp.favicon parameter in the transformation scenario. See the
Adding a Favicon in WebHelp Systems topic from our documentation.