We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46407
    • 5 Posts
    hi I have an issue when using Ace and Formit's utility snippet for radio buttons and checkboxes in a static/external file. For example this code works fine in a chunk(which is formit's official example:

    <label>
    Numbers:[[+fi.error.numbers]]
    <select name="numbers" value="[[!+fi.numbers]]">
    <option value="">Select an option...</option>
    <option value="one" [[!+fi.numbers:FormItIsSelected=`one`]]>One</option>
    <option value="two" [[!+fi.numbers:FormItIsSelected=`two`]]>Two</option>
    <option value="three" [[!+fi.numbers:FormItIsSelected=`three`]]>Three</option>
    </select>
    </label>

    But when I paste this same code into a static html file in my modx file panel this part of the syntax turns yellow and gives an error "Unexpected character in unquoted attributes":

    [!+fi.numbers:FormItIsSelected=`one`]]
    [!+fi.numbers:FormItIsSelected=`two`]]
    [!+fi.numbers:FormItIsSelected=`three`]]

    Is there any way I can get around this?

    Thanks
      • 46580
      • 167 Posts
      Ace + CKEditor

      I have enabled Ace for HTML/Source editing in resources
      Modx setting > Editor to use > which_editor > Ace

      But... it works only when "Rich Text" is unchecked
      Is there a way to use ACE, resource side, with CKEditor / Source mode ?

      [ed. note: johnxx last edited this post 9 years, 8 months ago.]
        MODX lover
        -
        Développeur MODX / Webdesign / Solutions web
        • 39194
        • 149 Posts
        kevind_modx, This error is produced by HTML syntax checker. It's enabled for .html file extension and disabled for .tpl

        johnxx, which_editor is ignored. You can set use_editor modx setting to false to get ace for resources. So, ace is used whenever RTE is not used. I should add this info into readme...
          • 46580
          • 167 Posts
          johnxx, which_editor is ignored. You can set use_editor modx setting to false to get ace for resources. So, ace is used whenever RTE is not used. I should add this info into readme...
          Ideally I would prefer to enable/disable Ace by checking/unchecking "Rich Text" checkbox.

          Your solution works fine. Thanks!
            MODX lover
            -
            Développeur MODX / Webdesign / Solutions web
          • To use a Context Setting I had to hack the plugin at lines 85 and 105 to have it use
            $modx->controller->context->getOption('use_editor')

            instead of
            $modx->getOption('use_editor')

            However, I think this would break any User or Group setting.
              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
              • 8830
              • 98 Posts
              Is there a way to use Ace for Template Variables? (Ultimately Text Areas, not Rich Text)
                • 1061
                • 81 Posts
                Thanks again for custom height.
                Ace have a lot of commands, but I didn't find needful.
                I've searching useful tool - get list of all variables(constants and functions).
                This tool allows to check that is correctly written all vars.



                P.S. Some times you spend a lot of time to find annoying lapses.
                  • 32678
                  • 290 Posts
                  I've twice now tried Ace in ModX 2.3.3, but cannot get syntax highlighting or emmet functionality. Are there specific requirements for Ace in ModX?

                  Asking because this most recent test was in a local environment using MAMP. PHP etc all up to date, but maybe there's a specific module within MAMP that I need to turn on? Google didn't turn up anything specific between Ace, Emmet and MAMP...
                  • Not sure about emmet, but Ace does code syntax highlighting just fine on installation.
                      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
                      • 50150
                      • 6 Posts
                      Quote from: sottwell at Dec 20, 2012, 07:01 AM
                      All I can say is that I like it; there was a minor issue with the default skin and the developer of Ace was very responsive and got it fixed quickly.

                      Hi, this might be a dead thread, but you mentioned you changed the skin for Ace? How did you do that? My editor still looks like this , which is better than plain text, but still not the sublime text-like interface I was after. Sorry if this is a really basic question, I'm very new to ModX and web design in general.