We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Quote from: Dimmy at Jun 20, 2006, 09:10 AM

    And does the "regular" tags like [!snippetname!] still works? or do we need to update all snippets templates chunks etc?

    Yes, they will still work with the new Parser. The parser is backward compatible with previous syntax.

    I would however encourage that you use the new tags whenever possible but you don’t have to modify you existing pages.

    One other thing that I forgot to mention was that it’s also possible to pass url parameters using [[~]]

    [[~10?lang=en&cn=us]]
    or [[~~10?lang=en&cn=us]]


      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 10487 MODX Staff
      • 1,535 Posts
      Great work, Raymond! Just off to try it out now.
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com
        • 32963
        • 1,732 Posts

        Many thanks to all for helping to test and optimize the parser.

        One of the things that future versions of the parser should be capable of doing is to determine MODx tags from none MODx tags.

        Consider the following:

        [[The Mary had a little lamb story. Go to [[~10]] ]]

        The parser should only parse [[~10]] and then return:

        [[The Mary had a little lamb story. Go to /littl-lamb.html ]]
          xWisdom
          www.xwisdomhtml.com
          The fear of the Lord is the beginning of wisdom:
          MODx Co-Founder - Create and do more with less.
          • 7455
          • 2,204 Posts
          If a snippet does not exist in the "old" version of the parser then nothing is returned
            follow me on twitter: @dimmy01
            • 32963
            • 1,732 Posts
            Quote from: Dimmy at Jun 20, 2006, 03:41 PM

            If a snippet does not exist in the "old" version of the parser then nothing is returned

            That’s true Dimmy but we have to be careful with the handling of [[ and ]] tags. Run away [[ and ]] can present unexpected results.

            I think the parser must be able to determine a valid parser tag from an invalid parser tag.

            From example [[The mary had a little lamb nursery rhyme...]] is not consider to be a valid tag.

              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 18397
              • 3,250 Posts
              This is awesome Raymond! I’ll definitely try this out in a few days (I have finals right now... ). Out of curiosity, what made you change from symmetric [~id~] to an asymmetric view [~~id]?
                • 32963
                • 1,732 Posts
                Quote from: Mark at Jun 21, 2006, 12:25 AM

                Out of curiosity, what made you change from symmetric [~id~] to an asymmetric view [~~id]?

                Well we had to change the format to make it much easier to parse and much simplier to write. I believe things would have gotten a bit complicated if we where to retain the old format.

                [[~10?&param=`value`~]]
                [[$Chunk?&param=`value`$]]

                Also note that the new [[~~id]] tag will return a perma link while [[~id]] will return the standard document link.

                PS. All the best on your finals.


                  xWisdom
                  www.xwisdomhtml.com
                  The fear of the Lord is the beginning of wisdom:
                  MODx Co-Founder - Create and do more with less.
                  • 18397
                  • 3,250 Posts
                  Thanks for clarifying and the nice words
                    • 7455
                    • 2,204 Posts
                    so what if I made a snippet called The mary had a little lamb nursery rhyme... ? or are spaces not alowd in a snippet name? wil they be replaced by a - ?
                      follow me on twitter: @dimmy01
                      • 6726
                      • 7,075 Posts
                      One way to settle this would be to have something displayed if debug mode is "on" (some snippet have a debug parameter, like Ditto). Let’s say I am improperly using a snippet (say, forget to close a backtick or whatever), if the parser just ignores it as an invalid call, it would help to know that something if wrong, rather than have it output an empty string... wouldn’t it ?
                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l'outil id