Forum Discussion
Ravi Chandra
Jul 07, 2018Copper Contributor
Convert Classic root site to Communication site
In our recent intranet projects, we recommend users to go with main Intranet site using communication site template and we expect that to be the root site collection of the tenant. The issue is ever...
Ravi Chandra
Sep 04, 2018Copper Contributor
Super simple...
On the root site collection add a classic page and add a script editor webpart. Paste the below code. Update the site URL.
=================================
<script>
var wikiInEditMode = document.forms[MSOWebPartPageFormName]._wikiPageMode.value;
if (wikiInEditMode == "Edit")
{
// wiki page is in edit mode
}
else
{
// wiki page is not in edit mode
location.href = 'NEW SITE URL';
}
</script>
===========================================
Ravi
KD10018
Mar 26, 2019Brass Contributor
Ravi Chandra Where exactly is the code going please? Site Settings > Site contents > New page > Add web part "Code snippet" > paste in code? This is the more apparent place to create a new page; not sure if there is a different place to add maybe a classic page or if this type of page is alright.