Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jesper Hauge 298 posts 487 karma points c-trib
    Jun 29, 2009 @ 17:51
    Jesper Hauge
    0

    Adding a stylesheet for use in the backend

    I'm currently developing a user control, which is in sore need of some styling. So I'm trying to figure out how to extend the Umbraco backend with some styling. 

    First I tried to insert the styles I needed in the stylesheet configured for use by the Rich Text Editor, counting on this stylesheet being loaded by the Umbraco backend, but a closer scrutiny revealed that this was not the case.

    I tried adding the stylesheet from code like this:

    var stylesheetLiteral = new LiteralControl();
    stylesheetLiteral.Text = @"<link href=""/css/umbextras.xss"" type=""text/css"" rel=""stylesheet"" />";
    Pager.Header.Controls.Add(stylesheetLiteral);

    But no dice. I guess the /umbraco/editContent.aspx page doesn't have a hader section with runat="server".

    I could off course add the styles to one of the stylesheets included in the Umbraco source code, but that would make my usercontrol vulnerable in future umbraco updates.

    Does anyone know of a safe way to do this?

    Regards
    .Hauge

     

  • Jesper Ordrup 1019 posts 1528 karma points MVP
    Jun 29, 2009 @ 18:15
    Jesper Ordrup
    100

    Quick hack - this one will get the job done .. not the completly right way of doing it :-) but ...how bout just adding your styles just above your code

     <STYLE type="text/css">
    H1 {border-width: 1; border: solid; text-align: center}
    </STYLE>

    Sure ... it belongs in the header but it will work and you're safe for now.

    /Jesper

  • Jesper Hauge 298 posts 487 karma points c-trib
    Jun 29, 2009 @ 18:34
    Jesper Hauge
    0

    I know - but it isn't valid html, so I was wondering if there was a way I didn't know about.

    .Hauge

  • Jesper Hauge 298 posts 487 karma points c-trib
    Jul 08, 2009 @ 12:34
    Jesper Hauge
    0

    Seems that there isn't any other ways than what Jesper Ordrup outlined above, So I've marked that as a solution.

Please Sign in or register to post replies

Write your reply to:

Draft