We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38813
    • 29 Posts
    I've noticed a rather unusual problem with CSS resource containers on a completely clean install of Revo 2.3.3

    If I create a resource and access it from the site, CSS loads fine and works perfectly but if I make that resource a container by adding a child, the CSS does not load any more for that page and I get a completely unstyled page.

    I've tried creating a new resource and same again - the CSS works perfectly but as soon as I add one child to it, no CSS and I get an unstyled page again.

    Has anybody else seen this or does anybody have any idea what it going on.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Container resources are given a suffix of /, so your container CSS resource no longer has the suffix of .css

      You would need to disable the alias_path setting, set the container suffix to empty, and put the full alias.css in the container resource's alias.



        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 38813
        • 29 Posts
        Quote from: sottwell at Feb 22, 2015, 01:13 PM
        Container resources are given a suffix of /, so your container CSS resource no longer has the suffix of .css

        You would need to disable the alias_path setting, set the container suffix to empty, and put the full alias.css in the container resource's alias.




        Is this necessary when I'm just loading the css using:

        <link rel="stylesheet" type="text/css" href="./assets/templates/ones/styles.css" />

        I haven't seen this behaviour before Revo 2.3.3 which has me confised.

        Thanks a mil.
          • 13428 ☆ A M B ☆
          • 1,031 Posts
          Use the following (remove the dot before the first slash):
          <link rel="stylesheet" type="text/css" href="/assets/templates/ones/styles.css" />
          

          A path that is starting with ./ points to the same 'folder' as the current 'file'. By changing the resource to a container it is changed from /alias.html to /alias/. The path /alias/ is (almost) the same as /alias/index.html so you are a level deeper and the css is retrieved from /alias/assets/templates/ones/styles.css which is not existent.
            • 38813
            • 29 Posts
            Quote from: Jako at Feb 22, 2015, 04:14 PM
            Use the following (remove the dot before the first slash):
            <link rel="stylesheet" type="text/css" href="/assets/templates/ones/styles.css">
            

            A path that is starting with ./ points to the same 'folder' as the current 'file'. By changing the resource to a container it is changed from /alias.html to /alias/. The path /alias/ is (almost) the same as /alias/index.html so you are a level deeper and the css is retrieved from /alias/assets/templates/ones/styles.css which is not existent.

            Ahhh gottit! I'll make the changes.

            Thanks a million for your help
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Oh, I'm sorry... I thought you were referring to using CSS-type resources instead of files for your CSS.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org