Page view counter

Custom Module Stylesheet Link in 3

Last post 03-16-2005 1:26 PM by svoeller99. 5 replies.

Sort Posts:

  • Custom Module Stylesheet Link in 3

    03-15-2005, 2:44 PM
    • Loading...
    • sconard
    • Joined on 12-02-2003, 2:31 PM
    • Posts 134
    • Points 585
    I was using a stylesheet link in my custom modules that looked like this.

    <LINK id="StyleSheet" href="./desktopmodules/wrallp.servicerequest/stylesheet.css" type="text/css"
    rel="stylesheet" runat="server">

    For some reason this fails in dnn 3.0.
    Any Clues?

    Thank you.

  • Re: Custom Module Stylesheet Link in 3

    03-15-2005, 3:46 PM
    • Loading...
    • svoeller99
    • Joined on 08-12-2004, 5:32 AM
    • Portland, OR
    • Posts 73
    • Points 365
    You could always remove the link tag and place your CSS into a file called 'module.css' in the base directory as your module. The skinning engine looks for this file when processing your module. I don't know exactly why your method wouldn't work, but this technique has worked for me.

    Sean
    Sean Voeller
    Rapidigm, Inc.
  • Re: Custom Module Stylesheet Link in 3

    03-15-2005, 3:53 PM
    • Loading...
    • svoeller99
    • Joined on 08-12-2004, 5:32 AM
    • Portland, OR
    • Posts 73
    • Points 365
    You might also try the CSSInclude module:

    http://www.dnnstuff.com/Default.aspx?tabid=210
    Sean Voeller
    Rapidigm, Inc.
  • Re: Custom Module Stylesheet Link in 3

    03-15-2005, 4:20 PM
    • Loading...
    • xddg
    • Joined on 12-10-2002, 10:09 AM
    • Melbourne
    • Posts 1,874
    • Points 9,364
    • TrustedFriends-MVPs
    is there a . in there that shouldn't be?

    Why would you not be using the module.css class that some developers use.

    I thought if there was one in there - it would be picked up first, next choice would be the skin.css file residing in the client skin folder.

    I've also see some developers allow for custom code to be dropped into the admin/settings style sheet editor so that no matter how many child portals are installed, they have the ability to create their own look and feel.

    This to me is true portability and all the tools are there for developers to do this, but I'm not sure how many know about it.

    Hope this gives an insight.

    Nina Meiers

    Nina Meiers


    Free Skins & Containers by Nina Meies
  • Re: Custom Module Stylesheet Link in 3

    03-16-2005, 9:05 AM
    • Loading...
    • sconard
    • Joined on 12-02-2003, 2:31 PM
    • Posts 134
    • Points 585
    Subsequent to this problem, (which was solved by using module.css. Thank You) I started to convert another module. None of the images (same relative path) I had depicted are found either. I do not want to hard code in page behind path from dotnetnuke/desktopmodules...etc. since many, including myself, rename the portal including the root folder. Any suggestions as to how I can use a relative path in the code behind?

    Failing section:
    Case 1
    imgMap.ImageUrl = "images/1floorsr.jpg"
    imgMap.Visible = True
    LinkButton4.Visible = True
    lbMapHint.Visible = True
    strCtrl = "1%"
    Case 2
    imgMap.ImageUrl = "images/2floorsr.jpg"
    imgMap.Visible = True
    LinkButton4.Visible = True
    lbMapHint.Visible = True
    strCtrl = "2%"
    Case 3
    imgMap.ImageUrl = "images/3floorsr.jpg"
    imgMap.Visible = True
    LinkButton4.Visible = True
    lbMapHint.Visible = True
    strCtrl = "3%"
    Case 4
    imgMap.ImageUrl = "images/4floorsr.jpg"
    imgMap.Visible = True
    LinkButton4.Visible = True
    lbMapHint.Visible = True
    strCtrl = "4%"

    Thank you in advance
  • Re: Custom Module Stylesheet Link in 3

    03-16-2005, 1:24 PM
    • Loading...
    • svoeller99
    • Joined on 08-12-2004, 5:32 AM
    • Portland, OR
    • Posts 73
    • Points 365
    I'm running into similar issues - it seems to be a bad idea in DNN3 to use paths to files, whether relative or otherwise, since this info is now stored in the database. I think that the path to which you're pointing is the 'images' subdir of the main DNN directory. This thread might help you: http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=751442

    Basically, to do what you're trying to do and avoid necessitating a hard path, you need to change your database to hold a FileID value, rather than a path (used by the URLControl, for example). Then, run a query similar to the following:

    select 'URL' = case when Files.FileName is null then Table.URL else Files.Folder + Files.FileName end
    from Table
    left outer join Files on Table.URL = 'fileid=' + convert(varchar,Files.FileID)
    where Id = @Id

    Another thing you might try - since your relative path is going to use the DNN virtual directory as its base (since we're always running from \{DNN Dir}\default.aspx), you could code a relative path such as the following:

    imgMap.ImageUrl = "desktopmodules/{your module dir}/images/4floorsr.jpg"
    Sean Voeller
    Rapidigm, Inc.
Page 1 of 1 (6 items)