We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29635
    • 361 Posts
    So, after long than I care to admit, I found something out that may help others.
    When using the NewsPublisher snippet with a chunk, if you’re having problems, remove any whitespace after defining the chunk.

    Examples:
    This works: [[NewsPublisher? &formtpl=ChunkName]]
    This doesn’t: [[NewsPublisher? &formtpl=ChunkName ]]

    I ran into this problem because I’m in the habit of putting spaces in between all my variables, like this: [[NewsPublisher? &folder=33 &template=AccessWebCourse &showinmenu=1 &aliastitle=1 &clearcache=1 &formtpl=CourseAdd ]]

    That extra little space took me too long to figure out! Hopefully my wasted time will save somebody else smiley Anybody have any idea if that’s how it should be, or if the NewsPublisher could be written to fix that?
    -Brett
      Need MODx Ecommerce? Try FoxyCart!
      • 32963
      • 1,732 Posts
      Quote from: The at Nov 22, 2005, 02:14 AM

      Examples:
      This works:  [[NewsPublisher? &formtpl=ChunkName]]
      This doesn’t:  [[NewsPublisher? &formtpl=ChunkName ]]

      It’s best to use:

      [[NewsPublisher? &formtpl=`ChunkName` ]]

      Please note the ` character
        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 29635
        • 361 Posts
        Believe it or not, that doesn’t work. Sorry, I should have noted that in my first post.
        Doesn’t work: &formtpl=’ChunkName’ ]]
        Doesn’t work: &formtpl=’ChunkName’]]

        Nothing with single-quotes (or double-quotes) works, regardless of whitespace. I swear I’m not crazy. wink I’ve doublechecked that the snippet hasn’t been modified, and I’ve tested on another installation as well with the same results.
          Need MODx Ecommerce? Try FoxyCart!
        • Those are supposed to be backticks (left of the 1 key), not single-quotes.
            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
            • 29635
            • 361 Posts
            That would do it! Sorry for my ignorance. Combined with declining eyesight and high resolution, I couldn’t tell the difference.

            Thanks Raymond and Susan. Much appreciated.
              Need MODx Ecommerce? Try FoxyCart!
            • Don’t feel bad, it took me a couple of months before I finally started getting that right. And I know what you mean about declining eyesight. rolleyes
                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
                • 32241
                • 1,495 Posts
                Waow...

                That’s the same problem that I encountered when I first started using MySql a few years ago. They all looks the same, right?
                  Wendy Novianto
                  [font=Verdana]PT DJAMOER Technology Media
                  [font=Verdana]Xituz Media
                  • 13577
                  • 302 Posts
                  OK folks, please educate me. The backtick thing is new to me as Eto didn’t require it at all in snippet parameters. Why is this considered superior? And is all white space between parameters ignored? For example could you do this:

                  [[SomeSnippet?
                    &firstParam=`value 1`
                    &secondParam=`2`
                    &thirdParam=`etc`]]


                  And on the note of eyesight - I had Lasik eye surgery. So my declining vision is now 20/20! What a miraculous use of technology.
                    Standard Disclaimer
                    I could be totally wrong.
                  • I think the backtics are used because it’s likely to have a use for actual single- and double-quotes. For instance
                    &accessDeniedMessage=`I'm sorry, you don't have access to that!`
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • MySQL does this, allowing backticks for such things as database, table, and field names:

                      As of MySQL 3.23.6, names can be quoted within backtick characters (’´’), which allows use of any character except backtick, ASCII 0, and ASCII 255. This is useful when a name contains special characters or is a reserved word. Quoting a name also allows it to be entirely numeric, something that is not true of unquoted names.
                        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