We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I happened to notice this behavior while setting up a NewsPublisher call. My npOuterTpl includes this bit where I try to set a CGI/$_GET parameter in my form action:
     
    <form id="newspublisherForm" action="[[~[[*id]]? &parent=`[[+parent_id]]`]]" method="post">
    


    I'm setting the "parent_id" placeholder via a different Snippet. However, it doesn't seem to parse correctly. When I generate the page, it comes out like this:

    <form id="newspublisherForm" action="index.php?id=117&parent=%5B%5B%2Bparent_id%5D%5D" method="post">


    This is something to do with the MODX parser -- it doesn't like placeholders passed as arguments to the "~" link tags. The behavior is the same when you paste that on any MODX page or template. The link does generate correctly when you hard-code the value and skip the placeholder, e.g.

    [[~[[*id]]? &parent=`123`]]


    So is this expected? I would think it's legit to use a placeholder to pass arguments to Snippets, e.g.

    [[!mySnip? &arg=`[[+fill_me_in]]`]]


    Is that the case? Thanks for any thoughts.

    MODX 2.2.7
    • I wonder if this is specific to 2.2.7, there have been other problems with the link parser (with cross-context links).

      Would it be practical to use your own snippet to call makeUrl instead? I bet that would parse the placeholder correctly before passing it to the snippet.