
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 11:18 AM
Is it possible to modify the title attribute of a page server-side? We would like to open up some of our Knowledge Base articles to Google and the only way I know to modify the title of a ServiceNow page is using client side javascript and setting top.document.title dynamically. Does this work to change the title that Google displays in search results? If not, is there a better way? Erich Zirnhelt mentions in his blog post Enhancing KB Articles with metadata for SEO and Social Sharing that ServiceNow modifies the title on every Knowledge Base page and that Google uses the title in the search results, so this must be possible. Thanks for any ideas.
Solved! Go to Solution.
- Labels:
-
Knowledge Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 01:56 PM
For everyone's benefit, here is the answer from Michael Wimble:
If you create a UI Macro with the name 'html_page_title', you can dynamically create on the server side the title for the page. The macro should ultimately produce the '<title>blah blah</title>' element.
If you try this client-side, search engines are not going to execute any Javascript, and will only see the raw form of the page.
I will try this and report back.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 11:21 AM
Hi Shawn,
For better visibility, I moved your question to the Implement sub-community (and out of Community Updates & Feedback ).
Thanks,
Lawrence
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 01:54 PM
I mentioned a solution in Erich's article.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2014 01:56 PM
For everyone's benefit, here is the answer from Michael Wimble:
If you create a UI Macro with the name 'html_page_title', you can dynamically create on the server side the title for the page. The macro should ultimately produce the '<title>blah blah</title>' element.
If you try this client-side, search engines are not going to execute any Javascript, and will only see the raw form of the page.
I will try this and report back.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2014 05:37 PM
Michael Wimble: I am having difficulty accessing the title of the KBA from the UI Macro. I have tried various ways including using RP.getParameterValue('sys_kb_id') but I found out that RP is not Defined in UI Macro. I tried looking to the kb_view UI Page for hints, but it's mostly references to xml files that I can't get to from the ServiceNow UI. So now I'm hoping you could at least provide a proof of concept example for grabbing the article title from the html_page_title UI Macro. Bonus points if it can also distinguish between page types and display something generic for anything that's not a KB Article.