www.netsi.dk

"The internet is just a layer on the real world" (don't forget that!)

Ensure that news items in Dynamicweb CMS are rendered correct

In CMS when you click to a detail view of a item you will by default get a parameter “M=” or “M=NewsV2” depending on the Module version. That parameter will make your details view render incorrect. You can fix it in your template, but if you use the RSS feed of items, you cannot do that.

The javascript below will fix that problem by redirecting the page to an URL without those two parameters. It is a simple javascript, just insert it into the HEAD section.

<script type="text/javascript">

// Dynamicweb CMS fix: Make sure that details view of news item is rendered correct

// Insert in Master page in HEAD section

// Will redirect to same URL but with any "M=News/M=NewsV2" removed

// 2010-06-29: Sten Hougaard, Bleau A/S

var loc = document.location+'';

var newLoc = loc.replace('&M=NewsV2', '').replace('&M=News', '');

if (loc!=newLoc) {

 document.location = newLoc;

}

</script>
Share
Category: Code, dynamicweb

Your email address will not be published.