We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3325
    • 21 Posts
    hi

    i am using the contents of some template variables in my maxigallery templates, and for some reason all work except one called tvEnglishTitle.

    I renamed my TV to tvEnglishTitl (without the e) and it works...

    i am puzzled... are there some names not allowed for TVs?

    thanks!
      • 7923
      • 4,213 Posts
      Hmm.. might be a bug then. I haven’t done the TV parsing function to MaxiGallery, I copied it from Ditto at some point. It’s pretty old code. I’ll take a look at it at some point.

      For now, try to go around it by renaming your TV’s.. Sorry.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 3325
        • 21 Posts
        Hey

        I am getting a weirder error...

        So I changed the TV name like I said and it worked. I then replaced all the occurrences of that TV in the chunk by its new name, and after I save that chunk, it stops working and displays nothing for the value of the TV.

        So i change the name of the TV again, replace one occurrence of it in the chunk, and then it works... Again, after i replace all the occurrences of that TV in the chunk by its new name and save the chunk, it stops working...

        I tried calling the snippet cached and uncached and it doesn’t make a difference.

        I am so puzzled. huh
          • 3325
          • 21 Posts
          I played around some more, and it seems that when i make more than one reference to my TV via [+maxigallery.pageinfo.tv.tvname+] in my chunk it stops showing. When I only have one reference it displays the value of the TV properly.

          That is not normal, is it?
            • 7923
            • 4,213 Posts
            Yeah.. it’s not normal..

            To be sure, you are running the snippet uncached, right?


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 3325
              • 21 Posts
              i am building a bilingual site, so i created a snippet that checks if $_SESSION[’language’] is ’fr’ or ’en’ and then calls the maxigallery snippet via the modx->runSnippet() function with different chunks, depending on the language. runSnippet calls the snippet cached, right?

              i mean, I could simply call the snippet the normal way [!Maxigallery? ... !] on both the english and french pages with different chunks that correspond to the language, but I find that making the same call to the "bilingual" snippet on both french and english pages cleaner... maybe that is a wrong way of doing it?
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                runSnippet isn’t cached or uncached. The wrapper snippet is the one that will determine whether or not it is cached. And in MODx there is no "right" or "wrong" way to do things; if it works and you’re happy then it’s the "right" way!
                  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