We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22897 ☆ A M B ☆
    • 209 Posts
    I’ve been trying for the past hour to make this work:
    [[PhotoThumbnail?photo=`[*myimagefield*]`]]

    where myimagefiled is a template variable I’ve defined.

    The problem is that the snippet gets passed the text [*myimagefield*] and not the contents of this TV. Is it possible to capture the contents?

    This is using MODx 0.9.5 rev 2106, on Apache 2.0.X with MySQL. Everything else works fine.

    Thanks!
      MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
      • 10313
      • 375 Posts
      It definitely is. I am using

      [[getVeranDateString? &anfang=[+veranStart+] &ende=[+veranEnde+]]]


      within a chunk and that works very fine. I do not use backticks as you can see, but I think that I first had them and that worked too. Maybe you misspelled some thing? it’s all case sensitive.

      Martin
        • 22897 ☆ A M B ☆
        • 209 Posts
        Hmm, I wonder if the chunk is the secret? The spelling isn’t wrong and i’ve tried both [*...*] and [+...+], removing the backticks and still nothing happens... it just passes the whole [*...*] string through to the snippet.
          MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
          • 22303 MODX Staff
          • 10,725 Posts
          Right now there is a very specific order of parsing going on in the core. This means you have to respect that order when processing occurs. See the wiki for an article which describes this order of execution.

          As part of the rewrite for 0.9.7, the new core parser respects true source order and nested tags, regardless of the types of tags being encountered. In other words, this will be possible very soon, but for now, you’ll have to find an alternate approach.
            • 22897 ☆ A M B ☆
            • 209 Posts
            Quote from: OpenGeek at Jun 04, 2007, 09:57 AM

            Right now there is a very specific order of parsing going on in the core. This means you have to respect that order when processing occurs. See the wiki for an article which describes this order of execution.
            Thanks, I’d studied that article earlier today, and from it gathered I shouldn’t have any problems, as rule 18 is assignment of TV’s, and rule 21 is the parsing of snippets back into the template.

            As part of the rewrite for 0.9.7, the new core parser respects true source order and nested tags, regardless of the types of tags being encountered. In other words, this will be possible very soon, but for now, you’ll have to find an alternate approach.
            Sadly this system is impossible to upgrade, as it’s been locked down by the IT department, and I am not allowed access to the PHP files! Which makes extending the site somewhat more ’fun’ than it should be!
              MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
              • 22303 MODX Staff
              • 10,725 Posts
              Did you try this?

              [!PhotoThumbnail?photo=`[*myimagefield*]`!]
                • 22897 ☆ A M B ☆
                • 209 Posts
                Ah, rule 18 is incorrect - rule 22 (the rule after Snippets) appears to be the substitution of template variables.

                Is there *any* way round this problem? Basically I’ve written a snippet to automatically thumbnail images, cache them, and deliver back the cached image. To do this I need to be able to pass in the image name to the snippet. Is there any way I can do this with 0.9.5? I’m hoping there’s an alternative approach that’s eluding me...
                  MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Quote from: pbowyer at Jun 04, 2007, 10:08 AM

                  Is there *any* way round this problem?
                  The uncached approach I posted below should work fine...
                    • 22897 ☆ A M B ☆
                    • 209 Posts
                    Quote from: OpenGeek at Jun 04, 2007, 10:05 AM

                    Did you try this?

                    [!PhotoThumbnail?photo=`[*myimagefield*]`!]

                    Interesting... if I try
                    [!PhotoThumbnail?photo=`[*myimagefield*]`!]
                    then the page calling the snippet won’t load.

                    If I try
                    [!PhotoThumbnail? &photo=`[*myimagefield*]`!]
                    then the page loads, and the value of $photo is NULL (no, not even an empty string).

                    The value of [*myimagefield*] is something like
                    http://218.15.27.6/path/to/Filename With Spaces(1).jpg
                    - whether that makes any difference.
                      MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!