40fingers / StyleHelper-Sko

Manipulate DNNCMS HTML, JS and CSS in #dnncms
https://www.40fingers.net/Products/DNN-Stylehelper
7 stars 2 forks source link

Add "intranet" menu start filter #13

Open Timo-Breumelhof opened 3 years ago

Timo-Breumelhof commented 3 years ago

I some cases it's more comfortable for a DNN CMS administrator if the Theme itself "makes" a visual switch based on the root page. This can be useful for for instance an Intranet based that's located in a page structure inside the main website.

Something like:

Home News Products Intranet Home News Files Contact

I now mostly add custom code for this to the Them / Skin, but I think it would be useful to use SH for this.


<script runat="server">

    Dim strIntranet = "intranet"
    Dim IsIntra as Boolean = IsIntranet(strIntranet)

    Function IsIntranet(Root as String) as Boolean

    If PortalSettings.ActiveTab.BreadCrumbs(0).TabName.ToLower = Root.ToLower Then
        Return True
    Else
        Return False
    End If

    End Function

</script>

<% If IsIntra = False Then %>
   <h1><a href="//<%=PortalSettings.PortalAlias.HttpAlias%>/<%=strIntranet%>">Main Website</a></h1>
<% Else %>
   <h1><a href="//<%=PortalSettings.PortalAlias.HttpAlias%>/">Intranet</a></h1>
<% End If %>

Note: Also add start id for DDR menu