DNN 6 Module Development - ActiveTab
Last Post 12/13/2011 10:26 AM by Joseph Craig. 8 Replies.
Author Messages
William Gilgenbach
Nuke Newbie
Nuke Newbie
Posts:4


--
12/12/2011 11:25 AM
    I'm developing a module in DNN6, and I'm trying to read a config file (XML Text) that's stored in the skin folder. I can use ActiveTab.SkinPath to return the skin path in View.cs. No problem there.

    However, if I try to use ActiveTab.SkinPath in Settings.cs, the path returned is to the Portal Default Skin (Dark Knight). That's not what I want.

    I tried to go after the skin path via the TabID like this: New TabController().GetTab(this.TabId , this.PortalId, true).SkinPath, but the SkinPath variable is empty.

    Does anyone know how I can access the SkinPath of my "actual" page from the Settings dialog?

    Thanks in advance.
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/12/2011 2:16 PM
    You want to use DotNetNuke.Entities.Tabs.TabInfo.SkinPath.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    William Gilgenbach
    Nuke Newbie
    Nuke Newbie
    Posts:4


    --
    12/12/2011 7:13 PM
    I think I did that. This is my "expanded" code:
    DotNetNuke.Entities.Tabs.TabController theTabController = new TabController();
    DotNetNuke.Entities.Tabs.TabInfo theTabInfo = theTabController.GetTab(this.TabId);
    string thePath = theTabInfo.SkinPath
    

    The .SkinPath property always returns blank.
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/12/2011 7:48 PM
    If your page is using the portal's default skin, then I think that this is the correct behavior. In that case, you'll have to look at DotNetNuke.Entities.Portals.PortalSettings.DefaultPortalSkin. If that is empty, you'll have to go to the host skin.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    William Gilgenbach
    Nuke Newbie
    Nuke Newbie
    Posts:4


    --
    12/13/2011 8:29 AM
    PortalSettings was the answer.
    From inside the module: new DotNetNuke.Entities.Portals.PortalSettings(this.PortalId).DefaultPortalSkin; seems to always return a consistent skin file name (from which I can extract the path), so my problem is solved.
    Thank you.
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/13/2011 9:05 AM
    This will work provided that your site uses the same skin or skins from the same package. If not, you could have different paths for pages with special skins.

    (My other question was why you want to read a file from the folder containing the skin. Normally, files like that would be placed in the portal root or a directory that is in the portal root. If your file isn't really related to the skin, I would recommend moving it.)

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/13/2011 9:21 AM
    Which version of DotNetNuke are you using? (I probably gave you a reference using the wrong version)

    You can download the "Compiled Help File" for your version of DotNetNuke from the download page. It's a nice way to explore the DotNetNuke namespaces.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    William Gilgenbach
    Nuke Newbie
    Nuke Newbie
    Posts:4


    --
    12/13/2011 10:04 AM
    I'm developing against 6.0.0, but running 6.1.0. I do have the DNN Help file. It does help quite a bit, although there is a lot of guesswork since so many properties and methods have only syntactic documentation.
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    12/13/2011 10:26 AM
    You'll also get intellisense help.

    Joe Craig, Patapsco Research Group
    Complete DNN Support


    ---