We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42228
    • 5 Posts
    Hello MODX Community -

    This is my 1st post. Downloaded to try out MODX yesterday for the first time. So far seems pretty awesome - somewhat easy to wrap my head around coming from a background of ExpressionEngine.

    Anyway, I was quite pleased to find an addon for Less CSS. I have used Less a few times, big fan. Wanted to get this addon running but I am perhaps misunderstanding something and I do not see my generated css, just the code for the index page. Here is what I've done so far...

    I created a blank document under my Resources tab, so far - since I am just starting this morning - it looks like this...

    Web
    >> Home
    >> CSS Less

    CSS Less is my document, set to CSS, unchached etc. Then the content for this document is...
    [[lessCSS? &path=`assets/less/` &file=`main.less`]]


    Then at root/assets/less/main.less is my actual Less file.
    Finally, my Hompage template calls the CSS Less doc like this...
    <link rel="stylesheet" href="[[~2]]" />


    So finally I go to my homepage in the browser, view code and the <link> for the Less generates like so...
    <link rel="stylesheet" href="index.php?id=2" />


    So then when I click the link inside Chrome's view code page, I only see then the code for the homepage again.
    Here is a link to the page... http://modx.iam-eric.com
    Does anyone have a clue what I have misunderstood or have done wrong?
    Many Thanks.
    Eric
      • 42228
      • 5 Posts
      Continuing to work a bit, I originally failed to notice that when I click on the ?index.php?id=2 link, where it seems to show the same source code, the css from the file show up in the body of the html... so, basically I see this...
      <!DOCTYPE html>
      <html lang="en">
      <head>
      ...
      </head>
      <body>
      
      body: { margin: 0; padding: 0; } <-- this is the content of my assets/less/main.less file!!
      
      </body>
      </html>
      


      Just to add to the above smiley
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Your CSS resource needs to be assigned a template of "(empty)".
          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
          • 42228
          • 5 Posts
          Ohhhhhhhhh! Now I get it.

          I suppose that is what this means (in the Read Me)...
          Be sure to give your new document a blank template

          But I thought that meant a blank page... oops!

          Your re-wording made it quite clear - Thanks very much! It works now!

          Best,
          Eric