iftomkins
11 years agoMaven
Hide number of posts in page title
The number of posts for a particular category node is displaying as (0), so I've hidden it in the text on the page. However, it's still appearing in the page title (the one that appears in the <head>). http://screencast.com/t/rlbVxXnTtEZh
Any tips?
Here's the Freemarker + Javascript solution to remove the (#) from the page titles of certain nodes. I place it in my hitbox content.
<#if page.name?lower_case == "mobilecategorypage" >
<#assign currentNodeId = coreNode.id /><#if currentNodeId == 'product' || currentNodeId == 'discussions'>
//Remove (0) from page title on Help Forums and Support Node
var pageTitle = document.title;
document.title = pageTitle.replace(/\(.*?\)\s?/g, '');
</#if></#if>