We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13094
    • 58 Posts
    Hi there,

    I’m not sure if this is the propper forum area -- if not, please move this post, thanks.

    As a developer and designer, I’m a friend of lazy shortcuts. Unfortunately, in modx the way to the appropriate CSS-file is a long one. During development processes or at least every time I have to switch between content, ressources or file-manger for a quick CSS-edit, I’m going slightly mad.

    I fixed this problem for my installation by adding a shortcut into my ressource-menu in the modx/manager/frames/menu.php like this:

    if($modx->hasPermission('file_manager')) {
    	// Manage-Files
    	$resourcemenu[] = '<li><a onclick="this.blur();" href="index.php?a=31" target="main">'.$_lang['manage_files'].'</a></li>';
    	
            // shortcut to templates
    	$resourcemenu[] = '<li><a onclick="this.blur();" href="index.php?a=31&mode=edit&path=UNIXPATH_TO_MODX_DIRECTORYs%2Fmodx%2Fassets%2Ftemplates%2Fdefault%2Fsite.css#file_editfile" target="main">Template-CSS</a></li>';
    }


    But this hack isn’t either elegant nor sustainable and not flexible anyway.

    Is there a other solution around? I can’t find something in the forum or documentation.

    Thanks for feedback,
    rolf
      • 3749
      • 24,544 Posts
      If you have an editor on your local machine with FTP, you can edit a local copy of the CSS file and FTP it up to the live site.

      I’ve also edited files in the Manager in a separate browser, although I think it’s only completely safe if you create a separate Manager user so you’re not logged in twice as the same user.

      In MODx Revolution, you can leave the file open in the editor and edit Resources and Elements in a popup window.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 13094
        • 58 Posts
        Yeah, normally I design an my local machine and ftp all the stuff on the server.
        But when I’ve to CSS live it’s terrific. With that hack I can use three windows or tabs for content, ressources and css without any problems.
        I’m just looking for a userfriendly way, you know?

        regards,
        rolf
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          you can also use a document as a .css file.

          Or a chunk, and use it in a <style...> block in the template head. Does it really matter on the browser end if the css is included in the document? A longer page, true, but one less file request to the server. Saves time, bandwidth, and server resources.
            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
            • 3749
            • 24,544 Posts
            It does look nice. I can easily FTP one file at a time inside my Editor (PhpED) and it’s about as fast as saving the file in the Manager.
            You can also put snippet code in a file and "include" it in the snippet.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 13094
              • 58 Posts
              @sottwell:
              the first one is that kind of modx-way, I’ll have get used to smiley

              the second way isn’t my favoured way. It’s just one request more and two less size documents that can be fetched and rendered quicker. And, for my way of peeping the code, I’ll get an easier to read document structure with a logical detachment, too.

              @BobRay:
              that might be a goog workflow, but I post this question, because I, or the users I wrote for, use a CMS. Obviuosly there is a bunch of apps that can make a developers live easier!!

              regards,
              rolf
                • 25663 MODX Staff
                • 12,272 Posts
                Or, you could make a one-click access to it by customizing the welcome page template with the same tweaks you made to the Menu, and maintain a clear upgrade path per site. Can now even be done via plugin (in Evo).
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me