Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8090483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:44:17+00:00 2026-06-05T19:44:17+00:00

I have several large CSS files and making a change can sometimes take a

  • 0

I have several large CSS files and making a change can sometimes take a few minutes just to find the right selector to change. I would like it if there was a nice ModX editor for CSS, but I haven’t been able to find one. I am willing to settle for splitting up my files into parts, as long as my site still renders. Can I do that and how? If there is a nice editor (plugin?) instead, where can I find one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T19:44:18+00:00Added an answer on June 5, 2026 at 7:44 pm

    I guess the real question is what kind of parts are acceptable for you. If you follow this question, you can begin the process of allowing ModX to manage your CSS. Once this happens, your options open considerably. Your CSS editing will then become easier and less time consuming depending on your level of expertise with ModX. This answer will be pretty simple, as it will show simply how to add a given selector as a resource. Other further development can be intuited from here, though.

    CSS as a Resource

    Once your CSS is being managed as a Resource (which takes about 15 minutes), you may utilize Templates, Template Variables, Chunks, Snippets and Plugins. Thisis actually pretty amazing, but setup can be a bit of a pain. You will basically be investing some time to save a lot of time in the future. The next logical step is split your Selectors accordingly, but you don’t want to break what currently works. Having a fluid understanding of the getResources addon will be crucial to further development.

    How to do it:


    1. Create a new chunk

    Click the Elements tab, and click “New Chunk”. Name it “css-selector”. Set the content to:

    [[+pagetitle]] {[[+content]]}
    

    It’s as simple as that. Don’t forget to click “Save”! This will let you set a Selector as a resource. It will use the title for the selector and content for the rules. You can forget about using those braces any more. Your new chunk will handle those from now on.

    2. Adjusting your Template

    Now, we just have to convince the template that it nows how to read parts, as well as not forget the whole. Open your CSS Stylesheet template (the one that says [[*content]] for its content). Adjust the code so that it has the following:

    [[!getResources?
      &parent=`[[*id]]`
      &depth=`1`
      &tpl=`css-selector`
      &includeContent=`1`
      &sortby=`menuindex`
      &sortdir=`ASC`
      &limit=`99`
    ]]
    [[*content]]
    

    Again, click “Save”. Let me explain the Template real quick. If you have child, they’ll get rendered first depending on their menu index. Further, it will render the contents of the document that are not children afterward. This will allow you to only make new resources for your most important selectors, while keeping the stuff that will never change in the main resource.

    3. Create a new Template

    This is so that your selectors don’t do anything funny and just render the content. Create a new Template named “CSS Selector”. Set its content to:

    [[*content]]
    

    4. Create a new Resource

    Create a new Resource. Set the title to the selector for the css statement you want to manage. Then set the content to the rules without the braces. For instance, if your css statement is: div#header .logo {border:0;}, you’ll set the title to div#header .logo and the content to border:0;. Set the resource alias to whatever you want. I use numbers for each one. Set the template to your new “CSS Selector”. Important Now, set the Parent Document to your Stylesheet. Click Save.

    5. Testing the Stylesheet

    First, Right-click your new resource and choose “View Resource”. This will just make sure that the statement was rendered correctly. It should simply say your rule in CSS format.

    Next, Right-Click the Stylesheet resource and choose “View Resource”. You should see the Selector at the top and all of the other rules below it.

    Final Considerations


    Observations

    • You’ll notice that your child resources do not have to be changed to “CSS” for Document Type. Only the parent stylesheet has to be. This allows for some neat stuff as your expertise with ModX grows.

    • You can change the order of rules by simply changing the menu index of them.

    • The number of rules that can be done this way is based on the &limit variable in the getResources statement in your template. &limit applies to each stylesheet, so in this example you have 99 statements per stylesheet that may be separate resources.

    A Note on Server Load

    This will place load on the server as the number of resources goes up. For development, keep the “do not cache flag” (!) on your getResources statement. Once you are done, remove the exclamation mark and let it all be cached. This will save a ton of load.

    Further Development

    • I added an isEnabled template variable to mine so I can turn on and off each rule as I pleased.
    • You may possibly begin to manage your CSS on the front-end utilizing FormIt.
    • Custom Manager Pages may even be a better option for you.
    • Further abstraction might allow you to create Groupings of statements for even further organization.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several large text files (30m+ lines, >1GB) which are being processed in
I have several csv's that look like this: I have several large text files
We have several fairly large JavaScript files embedded into a single script resources DLL.
I have several fairly large XML files that represent data exported from a system
I have several large .xml files. I want to parse out the files to
I have several large text text files that all have the same structure and
I have several large csv files with thousands of columns that I need to
I have several large files, each of which I want to chunk/split it in
I have several large Javascript files that I need to document/digg into. Unfortunately I
I have several large embedded bitmap files in my resource project. The compiled exe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.