Announcement

Collapse
No announcement yet.

best place to link external stylesheet - html validation error

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • best place to link external stylesheet - html validation error

    Hi

    I love Font Awesome - http://fortawesome.github.io/Font-Awesome/icons/ - as you can see here http://development.mitsm.de/EduMS/mI...ement_System/# in my menu

    normaly the referenz schoul be placed in the header section

    Code:
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
    since i don't now how to modify the header section i placed it in the hedaer section of the menu - it works but ...

    Line 41 Column: 1
    Error: Tag link not allowed here.
    Error Position: <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/cs
    is ther a way in SC to place it in the page header?

    according to http://www.validome.org/validate/?ur...ent_System/%23 there are many more errors.

    any hints here?

    Thanks & Happy eastern,
    rob

  • #2
    Not too sure about all the other stuff but aren't you missing the [type="text/css"] attribute in your link-tag? Been a long time since i actually done proper webdevelopment like that but far as I can recall you need the type attribute...

    Far as the problem goes, the error you put in the quote seems to show that the link-tag is cut-off, but I'm assuming that's just a copy-pasting error.

    Oh and after some googling I stumbled upon this:

    Code:
    <style>@import url(/styles/mystylesheet.css);</style>
    Adding it on runtime does however make it so it might do a first render without the stylesheet then when it's imported do a second render with it rather noticable if a user has poor connectivity. Although on that front I'm uncertain whether you might have the same problem with what you're doing atm.

    EDIT:
    Oh and happy easter to you too!
    Last edited by hoihoi661; 04-02-2015, 04:37 AM. Reason: See EDIT

    Comment


    • #3
      Originally posted by mITSM View Post
      is ther a way in SC to place it in the page header?
      I suspect making a copy of the template your page is using, placing this in the header template and using that template in your menu app is worth a try.

      Comment


      • #4
        @scriptcaser
        i would have to do this in linux via command prompt? - sorry totally new to SC -

        @ hoihoi661 - thanks - that is what "they" tell me to do , and i think they should now it - hopefully -
        Paste the following code into the <head> section of your site's HTML.
        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
        from http://fortawesome.github.io/Font-Awesome/get-started/
        Last edited by mITSM; 04-04-2015, 06:02 AM.

        Comment


        • #5
          Originally posted by mITSM View Post
          @scriptcaser
          i wolud have to do this in linux via command prompt? - sorry totally new to SC -
          No.

          In your app config, Menu ==> Layout ==> Visual Settings will show you the header template your menu app is currently using.

          Then from main menu, Layout ==> HTML templates will allow you do what I enumerated.

          Comment


          • #6
            put it in onApplicationInit of the menu

            Comment


            • #7
              eventually I made myself not clear enough.

              Is ther a way do modify the <head> section of the HTML OUTPUT - all the solutions above have the result that the

              <link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css\">;

              is in the body section - AND ist only valid for teh "one" application not for ALL
              Thanks in advanced

              html_header.PNG
              Last edited by mITSM; 04-11-2015, 03:15 AM. Reason: add image

              Comment


              • #8
                @ scriptcaser - thanks for your solution - that is how i do it , but then it is in the <body> part of the html-output but I need to have it in the header

                @gerd I tried "include <link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css\">;" but no result at all - blnak page AND i guess it woul also be in the <body> part

                Comment


                • #9
                  rob,
                  attached a sample source , put it in a menu-onApplicationInit.

                  The result will be this: http://www.ecasan.de/live_test/gs_fr/mITSM/

                  Gerd
                  Attached Files

                  Comment


                  • #10
                    hi Gerd

                    thank you - getting closer but the link is still in the body-section not in the header -

                    html_header_II.PNG

                    cu rob

                    Comment


                    • #11
                      Rob,
                      Did you ever solve this? I have the same need.
                      Ed

                      Comment


                      • #12
                        I never tried it, but jquery can add stuff to the head element:

                        $('head').append('<link />');

                        Comment

                        Working...
                        X