Announcement

Collapse
No announcement yet.

cgi-bin and paths to css and js files

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

    cgi-bin and paths to css and js files

    v8 of actinic,
    in particular its order00.html (page 1 of the checkout) but it's going to be the same with many of the cgi-bin generated web pages

    I'm getting problems with the path to my css files.
    the web page is running /cgi-bin/os00004.pl which in turn manipulates order00.html to produce the output.

    I need to get back to where the javascript and css files are held on the server ( /actinic/*.* )
    so looking at the generated code, I can clearly see that there is a relative path to all the javascript files of ../acatalog/actiniccore.js etc
    but no matter what I do, I cannot generate the path to the css files.
    I've coded it to be ../acatalog/core.css but all it generates is core.css
    there's no mention of the ../actinic/ bit of the path

    if I do a preview to local disk, the ../actinic/ part of the path appears in all the correct places, but when it's uploaded, the ../actinic/ just disappears.
    I've tried putting the full http:// url in front of the call to the css files, again all the pre-fix dissappears

    anyone with a clue as to what's going on and how to cure the crazy code, I just want to force the generated html to look in the correct place for the css files

    kev

    #2
    References to CSS in layouts should be relative not absolute. The cgi-bin pages use a base href tag to convert to your store folder. If CSS is not displaying it could be a missing base href tag. Check your layout against a default.
    Peblaco

    Comment


      #3
      <link type="text/css" rel="stylesheet" href="nn4.css" media="screen" />
      <style type="text/css" media="screen">@import url("real.css");</style>
      <link type="text/css" href="coreCustom.css" rel="stylesheet" />
      <link type="text/css" href="core.css" rel="stylesheet" />
      <link type="text/css" href="core-print.css" rel="stylesheet" media="print" />
      <style language="javascript" type="text/javascript">#container-left {height:500px;min-height:500px;}</style>
      <script language="javascript" type="text/javascript" src="actiniccore.js"></script>
      <script language="javascript" type="text/javascript" src="actinicextras.js"></script>
      <script language="javascript" type="text/javascript" src="tabber-minimized.js"></script>
      <script language="javascript" type="text/javascript"><!-- saveReferrer(); // --></script>

      <BASE HREF="http://xxxx.co.uk/acatalog/">
      looking at whats happening inside the browser (firefox web-developer is brilliant for this)
      the styles that are the link that uses the @import url("real.css") happily looks in the right place, but all others keep looking in the cgi-bin

      lscgid: execve():/home/yyyyy/public_html/add-on-domains/xxxx.co.uk/cgi-bin/core-print.css: Exec format error
      clearing the cache hasn't done anything, so . . . .
      hmmmm ......
      I've noticed that I've got the BASE HREF tag after the links, I'll move it up and see what happens,
      mmm
      its solved the problem,
      the BASE HREF must be be above the script and css calls to take notice. - effectively, the FIRST thing in the <head> tag
      something to store in the back of the memory.

      Hopefully, this may help someone else in the future.


      thanks 'peblaco' - the BASE HREF was the clue I needed

      Comment


        #4
        Positioning of the tag is important - if you have the base href below CSS / Javascripts it won't work correctly. The base href has now been moved below meta tags and above CSS / Javascripts, a bug fix in 2013 "Moved the HTML Meta tags immediately below the Title tag to satisfy SEO analysers, SD-34" also see here.
        Peblaco

        Comment


          #5
          I'll tweak the positioning

          ooohhh...

          thanks

          kev

          Comment

          Working...
          X