We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • It would be possible to make a simple snippet to allow editing of an external stylesheet, and indeed every page can have its own template if you like. In fact, I was just introduced to the idea of using a snippet in the template form, and that snippet simply "include"s an external template file, which can now be edited in the editor of choice (via ftp) or again could be edited through a snippet. I suspect this would have a considerable performance issue on a busy site, but it’s something to consider under circumstances like this.

    Hm...I wonder if it would be possible to add a feature in QuickEdit to open a different document in QuickEdit; then you could have an option in QuickEdit to open the css document for the template of the document currently being viewed.
      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
      • 37272
      • 216 Posts
      Hi Susan,

      Would something like this really have such a large overhead? - I can appreciate that any editing involving the manager somehow, will hit the server, but how much editing there be? It will just be the blogger, and only when they are editing their template/CSS. I imagine most will just use default templates and CSS files anyway, as this is add-on space to a support forum. What I wanted to do was make the space more flexible (a My Space lite, if you will), but very few members will have the ability to do this, and will use the defaults and the WYSIWYG editor instead. I’m sure that you and the other creative genius’ around here would come up with ways doing this without too much strain on the server! grin

      I know that you are busy with the Shop code already! wink
        • 37272
        • 216 Posts
        Quote from: sottwell at Apr 17, 2006, 04:16 AM
        Just be careful to make sure that the config.inc.php file, created on installation in the /manager/includes folder, is not left world-writable after its creation.

        Hi Susan, or anyone,

        I CHMODed the config.inc.php file to 644, but when I use the manager now, the navigation tree is only displayed on the manager home page. I’ve changed the CHMOD back to 777, and the tree is available again. Is 644 the correct CHMOD, or is there something else I must do?

        Thanks.


        Edit: And now I can’t reproduce it. I guessed it might only happen with logging out, as it worked correctly last night after I had changed the CHMOD. I did find this thread, so it appears it maybe a bug: http://modxcms.com/forums/index.php/topic,2595.0.html
        • Quote from: Colin at Apr 18, 2006, 11:30 AM

          Would something like this really have such a large overhead? - I can appreciate that any editing involving the manager somehow, will hit the server, but how much editing there be? It will just be the blogger, and only when they are editing their template/CSS.

          MODx has to go to the database first anyway to get the document’s template, then if that template has an include, it has to go to the filesystem for the include file. Disk access is the most "expensive" thing you can do; you are more than doubling the time it takes before parsing can even begin. You would have to judge whether or not the site will be busy enough to really impact performance.
            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
            • 37272
            • 216 Posts
            Thanks Susan.

            I do have one more question. embarrassed Is there a way I can call different CSS files, but with same template. I’ll probably not use chunks now, because of the extra load, and add the code/text to the contents file. However, I will need to add some pices of CSS for these different blocks. Can I do this, and keep just the one temlate? - I will not add inline CSS.

            Thanks.
            • Chunks don’t add that much overhead, honestly. And if they stay the same on the template, then they can be cached, so it’s not a lot of extra load. You might want to investigate the regclient API functions for dynamically registering CSS on the page.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • You can use a TV that simply outputs the name of the css file, and then edit that name for every page you want a different css file for, or use @INHERIT. Or have your css as documents, and use @DOCUMENT, or chunks and use @CHUNK!
                  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
                  • 37272
                  • 216 Posts
                  Thanks Ryan.



                  huh rolleyes embarrassed shocked Thanks Susan. grin

                  I guess I’ll read a bit more. wink
                    • 37272
                    • 216 Posts
                    Hi,

                    I’ve only just managed to come back to this, and find that I’m still a little unsure of how use modx functions for a dynamic CSS file.

                    I anticipate that I will have different documents for page-specific CSS (for some small blocks), and these will be via a call from my main template. I understand the basic idea, that it will somehow be based upon the ID of specific page, but I can’t find enough explanation in the documentation. If I’ve not been clear, I’d like to use just one template, and for that to automatically obtain the correct CSS file for some small blocks that I will have dotted around different pages. This CSS will be different for every page, so this is why I need to do it this way.

                    Thanks.