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

    I would like to know if it was possible to use the Haml and sass language with modx ?


    Http://haml.hamptoncatlin.com/
    The Ruby principle of HAML is DRY, (Do not Repeat Yourself!)
    The goal is to avoid having to take unnecessary information for understanding the page by humans.


    Apparently, the time saving is incredible.
    And it is very simple to understand (if you know hTml & CSS, you already know hAml & sAss!!!).
    There is a PHP version which is slightly different than the original (which runs on ruby) here :
    Http://phphaml.sourceforge.net/


    A great list of editors allows editing Haml:
    http://groups.google.com/group/haml/web/syntax-highlighting
    And here (free for the moment) :
    Http://intype.info/home/index.php


    For mac users, texmate bundles are accessible here :
    http://macromates.com/svn/Bundles/trunk/Bundles/Ruby%20Haml.tmbundle
    http://macromates.com/svn/Bundles/trunk/Review/Bundles/Ruby%20Sass.tmbundle/


    Thank you
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Well, after reading the blurb on the site, in the first place I don’t consider MODx markup to be a "shitty template language". Maybe RHTML is; I’ve never seen it.

      Looking at their beginner’s tutorial is ... interesting.
      #content
          .left.column
            %h2 Welcome to our site!
            %p= print_information - (analogous to our [*content*] tag, I presume)
          .right.column= render :partial => "sidebar" - (possibly analogous to TVs or chunks?)
      


      I’ll bet debugging a misbehaving bit of layout is a real bitch.

      Here’s the PHP library port http://phphaml.sourceforge.net/

      This stuff makes my stomach hurt. It reminds me of Miami (and Tel Aviv) drivers speeding and weaving in and out of traffic just to gain a few minutes. If you’re that strapped for time, then set your alarm 15 minutes earlier.
        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
        • 22303 MODX Staff
        • 10,725 Posts
        WTF? ROFLMAO. That’s good comedy. I thought for sure this was a joke when I read the subject. I’m in shock, and to be honest, can’t stop wanting to say:
        "Don’t you SASS me!"
        That’s fine for Ruby and all. But I believe PHP and other languages already had this templating problem covered 10 years ago, without working-around (X)HTML in the process. And, well, wow; that’s just ugly...and a valid templating language for non-techies it’s definitely not.

        These guys should go to work for Microsoft as they have a great future in proprietary obscurity. Geesh, of course content should be DRY, but that’s what content management is for (i.e. it’s an organizational issue), and honestly, that is as unreadable as Ruby itself. I still like the RHTML better, but it’s no better than JSP or PHP either.

        Just another discussion resulting from the desire to mix logic and presentation in one big mess of code. Separate it and you don’t have a problem. But that’s just my opinion.
          • 7231
          • 4,205 Posts
          I have spent much effort to be proficient in css/html, a format that can be applied to every web development environment, what benefits would I possibly have in learning some obscure syntax in order to arguably save a few lines of code. Suddenly my code would be exclusive to some very limited group of developers, what benefit would this give my clients?

          Interesting, but personally not interested grin

          These guys should go to work for Microsoft as they have a great future in proprietary obscurity.
          Perfect observation.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 1687
            • 25 Posts
            I was sure you enjoy it.

            What do you think of this special Haml keyboard ?





            Ok I go to bed laugh
              • 17575
              • 3 Posts
              HAML and SASS: Funny names, seriously cool (albeit obscure) languages.

              Hands down, it’s easier to write HAML and SASS than XHTML and CSS when you’ve mastered them both. Less keystrokes to worry about, no closing tags to mirror. It really is a productive language. I wouldn’t recommend it for people learning XHTML or CSS, as it could have the potential to become a crutch

              SASS, with the real power there being the ability to use constants and arithmetic in your stylesheets, allows you to easily refactor your style code with a couple strokes of shift+tab. I don’t know about you, but I don’t exactly find joy in regex’ing my CSS selectors in 3000+ lines of stylesheet.

              If someone came along and made a HAML module for MODx, I would certainly not complain a bit. However, given it’s relative niche in Rails applications (though it has been ported to PHP - check out pHaml and phpHaml), I won’t be holding my breath.

              In the mean time for all those in favor of HAML just use the StaticMatic rubygem to code in HAML/SASS, then generate a static XHTML/CSS template from there.
                • 9550
                • 123 Posts
                yeah, I definitely would not complain if someone made a HAML module for MODx. It looks like fun smiley

                But SASS, that’s a deal breaker. Mixins and constants oh my! So awesome. And our style sheets are all flat files anyway.

                Anthony Short’s CSSScaffold is damn powerful, but was abandoned it in favour of coding the new version from scratch, which has yet to match the functionality of the old:
                http://github.com/anthonyshort/Scaffold

                You can still get the old CSSScaffold on a couple forks:
                http://github.com/balupton/CSScaffold

                  • 17499 ☆ A M B ☆
                  • 872 Posts
                  I join the point of view of OpenGeek (minus the hating remark on Microsoft, but i bet he has change slightly his point of view since they have announced a tiny partnership with M$ not so long ago).

                  However, if you want to speed up your development process without having forget about the standard HTML & CSS, maybe you can start learning Zen Coding.

                  http://code.google.com/p/zen-coding/

                  Available in most of the code editors (all the popular one have it, either as a plugin or natively -> PhpStorm) and while it speed up greatly front end development, its still the good old HTML/XML.

                  I use it on a daily basis and it saves me lot of times once masterized.