I received a request asking if we can append the HTML5 skin caption to the topic title that is displayed in the web browser tab.
Background information:
Currently, if you open the HTML5 skin, navigate to the General tab and enter text in the Caption field, when you generate the HTML5 output, the Caption is displayed in front of the topic title in the web browser tab. For example, if I had entered "Company Website" in the Caption field, and I click on a topic with the title "XYZ Widget" in the generated output, the tab will display "Company Website - XYZ Widget".
Initially, it was requested that we exclude "Company Website -" completely, because if a user has several tabs open, it'd be helpful for them to quickly distinguish between the tabs, by only displaying the topic title - "XYZ Widget". (In addition, we believe this will help with SEO?)
But now, it has been requested that we append the Caption to the topic title in the web browser tab, so that it would display "XYZ Widget - Company Website". Is this possible?
Append HTML5 Skin Caption to Topic Title in Web Browser Tab?
-
techwriter31
- Propellus Maximus
- Posts: 551
- Joined: Wed Mar 05, 2008 10:50 am
-
techwriter31
- Propellus Maximus
- Posts: 551
- Joined: Wed Mar 05, 2008 10:50 am
Re: Append HTML5 Skin Caption to Topic Title in Web Browser Tab?
Tech Support confirmed this is currently not an option. An enhancement request has been filed.
Kellie
-
Thomas Tregner
- Propeller Head
- Posts: 56
- Joined: Mon Apr 05, 2010 6:51 pm
- Location: Charleston
- Contact:
Re: Append HTML5 Skin Caption to Topic Title in Web Browser Tab?
As a note to anyone who is willing to add an extra step, this is another one which can be accomplished by tweaking the out-of-the-box script either in the source files for the skin or in the generated output. Although it is harder to do in the generated files if you select Performance > General > Condense JavaScript files.
In the output, when JavaScript is not condensed, the behavior is defined in MadCapDefault.js. The title is modified by grabbing the topic title and concatenating it with the " - <company name>" string. You can flip those with two small changes to MadCapDefault.js.
Or you can write a script to change it after the page is loaded.
In the output, when JavaScript is not condensed, the behavior is defined in MadCapDefault.js. The title is modified by grabbing the topic title and concatenating it with the " - <company name>" string. You can flip those with two small changes to MadCapDefault.js.
Or you can write a script to change it after the page is loaded.
Code: Select all
function flipTitle() {
flippedTitle = "";
originalTitle = document.title;
flipIndex = originalTitle.lastIndexOf(" - ");
if (flipIndex >= 0) {
flippedTitle = originalTitle.substring(flipIndex + 3) + " - " + originalTitle.substring(0, flipIndex);
document.title = flippedTitle;
}
}