Reputation: 694
Currently, the default page separator in dnn page title is ">". i want to change it globally to a different separator like "|" or "-"
e.g. - "SiteName | Home " or "SiteName - Home"
how could i do this?
Upvotes: 1
Views: 248
Reputation: 56
The javascript solution proposed will be ok for browser display, but not ok for search engines.
Although I'm not a proponent of making change to the DNN core, but to do a more permanent solution:
1 - Open the Default.aspx.cs file from the root folder of DNN;
2 - Replace " > " by " | " or " - " - Make sure you include the [DOUBLE QUOTES] + [SPACE] + [>] + [SPACE] + [DOUBLE QUOTES] when doing the search/replace. The search will find about 4 lines that will match/replace this.
Note: As this is a change in a DNN core file, whenever you do an upgrade on this site you will have to re-apply this change.
Upvotes: 0
Reputation: 59272
You can do it like this in javascript:
document.title = document.title.replace(/>/g,"|"); // if you want it with |
( or )
document.title = document.title.replace(/>/g,"-"); // if you want it with -
Put that in window.onload
window.onload = function(){
document.title = document.title.replace(/>/g,"|"); // if you want it with |
}
Upvotes: 3