Search code examples
dotnetnukemicrodatadotnetnuke-9

How to get the Absolute DNN Portal Logo URL Path for use with Microdata?


How can I get the current DNN Logo file's Absolute URL Path?

Currently, Google picks up the Relative Path. /Portals/2/Images/logo.png

I need the full path with the domain name.

I want something almost like: PortalSettings.PortalAlias.PortalID

The Google Structured Data Tool gives the following path after I have added itemprop="logo" to the logo.ascx file found under Admin/Skins in DNN.

enter image description here

enter image description here


Solution

  • I came up with the following code, but I only still need the protocol which will be http:// or https://

    The code below will generate dnndev.me/Portals/2/Images/logo.png

    I just need to figure out how to get the protocol. I am sure the code below can be simplified.

    PortalLogoPath = PortalSettings.Current.PortalAlias.HTTPAlias + PortalSettings.HomeDirectory + PortalSettings.LogoFile;