We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36451
    • 264 Posts
    As far as I know I can’t output a text like [[my_text_here]] in the content, because in MODx this means a snippet call. But I need to print a piece of text like this, because I need it as a placeholder for an external newsletter script (poMMo).

    Can someone give me a pointer, please?
      • 25663 MODX Staff
      • 12,272 Posts
      Easiest way:
      [<!-- -->[my_text_here]<!-- -->]


      Empty comments between the brackets (or other characters for other resources) seem to work.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 36451
        • 264 Posts
        Thank you, Ryan. Works fine in HTML view, but not in code view. I need this synthax as a placeholder in poMMo. But this fine little script uses exactly the same placeholders as MODx for personalization. That means the code must be [[ not [<!-- -->[ in the source sad
          • 25663 MODX Staff
          • 12,272 Posts
          That’s a good question... and I suspect it’d require writing a custom plugin that turns off the document parser when it encounters a <code> block. I have no suggestions.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            In my experience, MODx just ignores snippet tags that don’t have a corresponding snippet installed.
              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
              • 25663 MODX Staff
              • 12,272 Posts
              That’s very true... you could purposefully misspell the snippet name for illustration purposes... or call it my_text_here-demo ...
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 36451
                • 264 Posts
                Quote from: sottwell at Jan 15, 2007, 12:01 PM

                In my experience, MODx just ignores snippet tags that don’t have a corresponding snippet installed.
                Hm, not here. [[Name]] will be erased, even if there is no snippet called like that. Checked with 0.9.2 and 0.95, with and without RTE. [[Name]] inside a snippet or chunk does not work.

                I’m not sure, but maybe javascript will do that job?
                  • 36451
                  • 264 Posts
                  Solved. Maybe a kind of recursivity. I wrote a mini snippet [[Email]] with the output of - guess what - "[[Email]]":
                  <?php
                  $output = "[[Email]]";
                  return $output;
                  ?>

                  It doesn’t work, if I name the snippet something like [[PrintEmail]], it only works if I name it exactly like the output. That’s fun laugh

                  BTW: Post Nr. 100 grin grin grin
                    • 14050
                    • 788 Posts
                    Glad you figured it out, I was just about to suggest that.

                      Jesse R.
                      Consider trying something new and extraordinary.
                      Illinois Wine

                      Have you considered donating to MODx lately?
                      Donate now. Every contribution helps.
                      • 10298
                      • 53 Posts
                      hi yoomai
                      It would be nice if you could share with us what you did to implement pommo inside Modx.

                      It is a great newsletter and know that davidm would maybe try to implement it.