We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10313
    • 375 Posts
    Quote from: davidm at Sep 07, 2007, 04:34 AM

    ... uploading files to update the CSS is tiresome

    I thought so, too, just until yesterday. Then I accidently found out that the free editor PSPad http://www.pspad.com/ that I was already using for small tasks (the great work is done with eclipse), is capable of opening files directly via ftp and uploading it when saving the file. That’s great. No more saving and uploading, it’s just saving. Works great.

    Martin
      • 6726
      • 7,075 Posts
      Yeah PS Pad is great, used it when I was on PC but now I am on Mac and one of the few downside of TextMate is the lack of FTP feature (unless I missed something !)
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 10313
        • 375 Posts
        Oh what a pity. But I can imagine that there is an editor with ftp support. However, that’s beyond my knowledge.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Most Mac FTP client programs allow you to attach your chosen editor, so when you double-click (or choose "Edit" from the menu) it automatically downloads the file, opens it in your editor, and when you save, automatically uploads the modified file. No need to download, edit, save, upload. I use Cyberduck and Smultron as my FTP client and editor, but this also works with most FTP clients and quite a few editors. I even have some Mac utility or another (I foreget what it’s called) enabled that pops up a little message to let me know when the upload is completed, so I don’t end up refreshing my web page before the changes have been uploaded completely.
            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
            • 6726
            • 7,075 Posts
            Thank you Susan now that you mention it I remember seeing this in CyberDuck, I’ll go ahead and set this up smiley !
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 6726
              • 7,075 Posts
              Back to the issue at hand, I think I partly understand my issue with &chunkCSSName.

              I discovered why no CSS were rendered when using a chunk for the CSS : all the classes have a number appended (in my case 69), and after looking into it, it’s the chunk’s ID ! As the styles are not appended with the ID, it simply isn’t rendered...

              I guess it’s a feature not a bug since it’s exactly what was intended to begin with :

              [tt]<div class=\’CALxContent’.$this->chunkCSSID.’\’>’."\n";[/tt]

              logically renders :

              [tt]<div class=’CALxContent69’>[/tt]

              I checked, logic is identical for all classes.

              The thing is, the style for this div is :

                .CALxContent {
              	margin: 0;
              	padding: 0;
              	font-size: 1em;
              	margin-bottom: 1em;
              	margin-right : 1em;
              	margin-left : 1em;
              	text-align: center;
              	color: Black;
              }



              should be

                .CALxContent69 {
              	margin: 0;
              	padding: 0;
              	font-size: 1em;
              	margin-bottom: 1em;
              	margin-right : 1em;
              	margin-left : 1em;
              	text-align: center;
              	color: Black;
              }


              Which means that chunk CSS should either have a dynamically generated ID or - simpler - just add a space between the class and the chunk’s ID (and prepend it with something like "chunk" - can’t have a class with numbers only : e.g it would render chunk69) to allow for further styling based on the ID while not breaking the default style...

              In our case the style would read

                .CALxContent chunk69 {
              	margin: 0;
              	padding: 0;
              	font-size: 1em;
              	margin-bottom: 1em;
              	margin-right : 1em;
              	margin-left : 1em;
              	text-align: center;
              	color: Black;
              }


              [tt]<div class=\’CALxContent’.$this->chunkCSSID.’\’>’."\n";[/tt]

              would become something like (forgive my php tongue) :

              [tt]<div class=\’CALxContent’.’&nbsp;chunk’.$this->chunkCSSID.’\’>’."\n";[/tt]
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 6726
                • 7,075 Posts
                Just had a few exchange with Jabberwock via PM, it seems it’s already taken care of just add

                [<-chunkID->] after your classes, in the chunk CSS smiley

                .CALxContent[<-chunkID->]{
                	margin: 0;
                	padding: 0;
                	font-size: 1em;
                	margin-bottom: 1em;
                	margin-right: 1em;
                	margin-left: 1em;
                	text-align: center;
                	color: White;
                	border-color:white;
                	background-color: Black;
                }


                Thanks Jabberwock !
                :)
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l&#39;outil id
                  • 13320
                  • 245 Posts
                  Hello,

                  Yes, I’m sorry I put the wrong CSS class in the "style" directory.

                  I think I put a "CSSModel" directory with the right file for the next version :p

                  Sorry smiley

                  Edit : I join an archive with three chunck css model.
                    [b]D
                    • 6726
                    • 7,075 Posts
                    No need to be sorry, CALx is great, and testers are here to provide feedback to help out smiley

                    Thanks for the file !
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l&#39;outil id
                      • 10313
                      • 375 Posts
                      Hi, I found an additional thing regarding [tt]&chunkCSSName[/tt]. If you don’t use that parameter, CALx starts output with an empty "<style></style>" which XHTML doesn’t like.

                      I changed line 334 in function Run() to
                      $output= isset($this->cssChunk)?'<style>'.$this->cssChunk.'</style>':'';


                      So that [tt]style[/tt] should only be output when needed.

                      Additionally, I swapped lines 713 and 714 in buildCalx(). Before, there was an additional [tt]</tr>[/tt] after the last line. Now the HTML for the large table looks correct. However, I don’t know if this covers all special cases (e.g. when there are no empty days in the last row) ... For now, it works.

                      Greetings
                      Martin