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

  • SEARCH
  • Home
  • 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 8071919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:50:34+00:00 2026-06-05T13:50:34+00:00

I’ve been working with the ModX Revolution manager, and was wondering if I can

  • 0

I’ve been working with the ModX Revolution manager, and was wondering if I can turn my CSS into ModX Resources rather than files. I’d also like to utilize Templates and their variables. Is that possible? What are the drawbacks of doing so? Are there any advantages (aside from the ones I think below)?

The reason I would prefer this is that I use several CSS pages with the @import statement to object orient my CSS a little bit better. If I could do this directly in ModX, it would save me uploads and syncing.

  • 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-05T13:50:36+00:00Added an answer on June 5, 2026 at 1:50 pm

    In previous versions of ModX (Evo and Revo), you used to have to go through tricks. Now with 2.2.2pl, it is possible with very few tricks. The information to do this is sparse and inaccurate any more. Here’s how you do it:


    Create Your Template

    1. Create a new Template. I named mine CSS Stylesheet. (Simple as that)

    2. For the content, simply put [[*content]].

    Create Your CSS Page

    1. Create a new resource. Name it whatever you would like.

    2. Add your alias. Make sure you do not add the .css at the end. ModX should do this for you.

    3. Now, make sure your new page is published. You may also want to hide from menus.

    4. Add your CSS code. No funny tricks… Just copy and paste it like you normally would.

    Test the Stylesheet

    Simply navigate directly to your new page as if it were an html document. Don’t forget the .css instead of .html. If you see the CSS code, then you’ve succeeded.

    Add Your CSS to the Templates

    This one is the tricky part. You won’t be able to use the <link rel=></link>.

    1. Simply go to your <head> element. Add the following code:

      <style type="text/css">
      @import url("");
      </style>

    2. Test the

    3. Inside the url("");, just place the url to your new resource.

    Advantages

    Aside from the saving the uploading and downloading, you can now edit your CSS using any of the ModX tools. Additionally there are a few other perks:

    • If you’re like me, file names are useful, but often not descriptive enough. You can name them whatever you like! Its the alias that is important anyway.

    • Handy tool-tips based on the Description of the resource.

    • You may also utilize the Summary of the resource for other things. I place the important file comments in here, so that my CSS is smaller.

    • Template Variables! In previous versions of ModX, you couldn’t have a Template for your CSS.

    • Chunks and Snippets, if you so desire. You have to write them as plain text, rather than HTML, but it’s still useful if you are creative.

    • Your CSS is now shared between all of your Contexts if you like. This is due to the nature of the @import statement.

    • You can edit your CSS from any computer. You may even set up your front-end for the editing.

    Drawbacks

    There’s always trade-offs, and with this technique it is no different. A lot depends on how you have things set up for your site.

    • Your saving and editing is based on your server performance.

    • Your URL requests will be based even more on your ModX performance. For some, adding these extra resources could slow things down. Often, its not enough to worry about, but its worth mentioning.

    • It’s now managed by the database, so its subject to database security. This can be good or bad. Even it is good, it probably will require extra set up from you.

    • Your Templates, Snippets and Plugins can break your CSS, if programmed incorrectly. This is something you really want to be careful with.

    • Each CSS request is treated as a separate request by ModX. The Template Variables and plugins do not apply to the web page you are viewing. They apply to the CSS content.


    Conclusion

    The whole process takes about 15 minutes. And ultimately, it’s even faster to revert back if it doesn’t work for you (just don’t delete the raw files until you are sure). The added functionality is worth it to me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have been unable to fix a problem with Java Unicode and encoding. The
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Does anyone know how can I replace this 2 symbol below from the string

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.