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

    I am a newcomer to MODx-2.0.8 and wish to use it with ElastiCSS (http://elasticss.com). ElastiCSS applies classes to HTML constructs (typically DIV) and processes them using a Javascript engine.

    From the little amount of experimentation I have done with ElastiCSS, in conjunction with MODx, it appears that I will be required to put its content in the template and only have very simple HTML in the resources.

    Given these restrictions, I am seeking advice on how I might use chunks and templates effectively in this scenario.

    Am I also right in thinking that a WYSIWYG editor will be of little use to me in generating my resources and templates (as I am using little markup for the former and wholly HTML for the latter)?

    TIA,
    Neil Darlow
      • 33968
      • 863 Posts
      Hi Neil

      I really don’t see any restrictions here at all, depends what you want to achieve. Best to start by coding up a static html page outside of MODx using ElastiCSS - you could use your WYSIWYG editor for that if you wish. Then when you are happy with it you can drop the markup straight into a MODx template, simple as that.

      I always create a ’header’ chunk for the <head> section, and a ’footer’ chunk for my site footer as this code is going to be the same across all pages and templates. You could create different templates for 2-col, 3-col or whatever layouts you want to use from ElastiCSS.

      It’s then just a matter of replacing, say the content of the <h1></h1> tags with [[*pagetitle]], main copy with [[*content]], and anything else you might want to make editable via MODx.

      Check out one of these tutorials for a quick walkthrough and setup of a basic site - it will be 30minutes very well spent!
        • 21107
        • 3 Posts
        Hi Lucas,

        For some reason, ElastiCSS styles applied in a resource don’t render correctly but when applied in a template they do.

        If this is a reality (and I am not doing something really stupid) then I can imagine that I will need multiple resources and templates for a physical page constructed with multiple columns and boxes. Either that or the substitutions become more complex than simply [[*content]].

        Regards,
        Neil Darlow
          • 33968
          • 863 Posts
          Resources only really need to be used for the content itself, you shouldn’t have to be including markup in there.

          Did you mark up a static html page? If you post it here I’d be happy to suggest how to set up your template.
            • 21107
            • 3 Posts
            Hi Lucas,

            Thank you for the offer. I went back to basics, as you suggested, and things are working as they should.

            I now need to read more of the MODx documentation and determine how I should structure my site in terms of using chunks vs. TVs and other subtleties.

            I have also taken the opportunity to install MODx-2.1.0-RC3 as I will probably be deploying with 2.1.0-pl.

            Regards,
            Neil Darlow