Stripping underscores on a page

Office 365 / SharePoint Blog

​​When creating a new page, the title is the same as the file name.
As of this date, there currently is no way to split file name from page title.
It’s important that we do not include spaces in a file name, and that we instead use underscores.
Unfortunately, with underscores, we have a strange looking page title that includes underscores, which we can strip using a content editor web part.

This is what the title of this page would look like without the underscores stripped:

Page Head with Underscores

Check out the page, and place in EDIT mode.

In the footer of the page, or at the bottom of your site content, insert a Content Editor webpart.

You can find the Content Editor web part under the Media and Content category.

Insert Content Editor Web Part

Click on the little triangle in the top right hand corner of the web part, and choose Edit Web Part.

In the Content Link box, copy and paste the following:

/sites/dsa/SiteAssets/Javascript_strip_underscores.js

Content Editor Javascript Strip Underscores

Under the Appearance drop down, choose Chrome Style of NONE.
Then click OK and SAVE the page.

Content Editor Chrome None

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s