We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10726
    • 58 Posts
    Hello,
    I just trying to follow tutorial and couldn’t figure how to create CSS file and attach it to the new template.
    I could do it with notepad and upload via FTP, but it doesn’t feel like a CMS-way to do things.

    I was trying to follow this doc:
    http://modxcms.com/forums/index.php/topic,5258.0.html
    but stumbled at the very beginning on Item1:
    "1. In the manager, create a folder to store your stylesheets, not required but it’s cleaner. For the sake of this tutorial, this folder will be named "css"."

    Does it refer to directory ’/manager/’ ? or "manager" as an admin panel?
    If it refers to the directory ’/manager/’ - then I do not see this directory at all in ModX admin panel. Yet i see it exists in my FTP tool.
    If it refers to "manager" as definition of ModX "admin panel" - then clicking "New Folder" opens "Document Settings" dialog with bunch of fields that are totally unrelated to directory creation (Title, Long Title, etc..).

    I am sure that adding simple CSS file to simple template should be a bit less painful.

    Could anyone please guide me a bit here?

    Gleb
      • 25663 MODX Staff
      • 12,272 Posts
      The Manager is the control panel for MODx. It means to create a CSS folder/container in the tree menu and unpublish it. This way you can store CSS-files as documents in the menu tree and use all the available MODx resources in the CSS "file".
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 10726
        • 58 Posts
        Thanks,
        so should I use "Contents->New Folder" option to create directory or
        "Resources->Manage files->New folder" to create it?

        If first option is the one to use - what should i fill-in for all these fields?

        If second option is the right one (which I tried) - then I don’t see this directory to appear anywhere in the left panel.

        Gleb
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Content -> New Folder. Put in whatever you like. Basically, just give it a name to show in the Document Tree panel, and make sure it’s not published. Your CSS documents will be created in that folder. Right-click on it, then choose "Create document here".
            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
            • 28676
            • 136 Posts
            gleb - just a quick note becuase I just got this working myself, make sure you read the bit about the .htaccess file

            You need to uncomment the following lines by removing the # for each line of code. You may also need to do this by loggin onto your server, rather than a ftp client or dreamweaver.

            BrowserMatch "MSIE" brokenvary=1
            BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
            BrowserMatch "Opera" !brokenvary
            SetEnvIf brokenvary 1 force-no-vary



            Your tree view should now look like this


              I made my first site with modx
              ------------------------
              http://www.shop-bright.com | Uk shopping blog
              • 10726
              • 58 Posts
              Ok, thanks!
              (So what confused me was the definition of "directory" and "file". Apparently these terms are purely logical in ModX philosophy and exists only in "virtual" form in DB I guess? And I was looking for their physical counterparts. You guys might want to add this to the tutorial to avoid confusion from newbies).

              Here’s where I am now:

              I created folder and style.css document inside this ’css’ folder.
              So my tree looks like:
              -css
              --- style.css

              Then I edited template and replaced <link rel="stylesheet" ...... /> with:

              <style type="text/css">
              @import url(’css/style.css’); /* or whatever css_folder_name/my_style_sheet.css */
              </style>

              I also set "Uncached" by default in system settings.

              So when I reload site - CSS doesn’t seems to apply.
              The site is here: http://fly2c.com

              Did I miss some steps?

              Gleb
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Try the link just "style.css". This is presuming that you set your style.css document to have the alias "style.css", and selected the "text/css" type for it.
                  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
                  • 10726
                  • 58 Posts
                  I tried setting "style.css" instead of "css/style.css" - and it apparently slightly changed the look of font inside the table (see www.fly2c.com).
                  But it did not show any of the layout like tutorial has it.

                  Anybody wants to login to my CPanel and have a quick look?

                  Gleb
                    • 28676
                    • 136 Posts
                    What hosting do you use? did you change the .htaccess file. Mind you I checked your server and those files dont exist, so something is going wrong.
                      I made my first site with modx
                      ------------------------
                      http://www.shop-bright.com | Uk shopping blog
                      • 28676
                      • 136 Posts
                      If you email me your info I can login and check, dont post it here.

                      [email protected]
                        I made my first site with modx
                        ------------------------
                        http://www.shop-bright.com | Uk shopping blog