We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30095
    • 9 Posts
    I have noticed that when I insert the DateTime snippet in a template it needs to be reloaded every day. Some one can help me?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      How do you have the snippet tags? [[...]] or [!..!] the [[ method will cache the snippet along with the rest of the page, while [! will cause the snippet to be re-calculated on each page load.
        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
        • 30095
        • 9 Posts
        I use the [[ method. Now I try the second one and tomorrow I control the result. Thank you for all.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Any snippet whose output is liable to change needs to be in the [!...!] form. This includes the WebLogin snippet, or else it will continue to display the login form instead of the logout link after a user logs in!
            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
            • 30095
            • 9 Posts
            Tnk again. Very useful!! How to load also a TV every time the page is loaded?
              • 32241
              • 1,495 Posts
              It will be loaded and cached by the system. If you want to assign TV to a template to be used, then do it from the resources/template variables admin.

              Is that what you ask?
              Hope it answers your quesiton
                Wendy Novianto
                [font=Verdana]PT DJAMOER Technology Media
                [font=Verdana]Xituz Media
                • 30095
                • 9 Posts
                Yes, of course. But when I put a TV that load an external file like "@FILE news/news.txt", if I change the content of the file every day, I need to reload the site to activate the changes. So, I ask if there is a way to reload automatically the content of a TV (in this case the content of the file news.txt) without to enter in the manager and to press reload the site, exacly as the difference between [[ and [! for the snippets.
                Thank you.
                ModX is incredible!
                  • 18397
                  • 3,250 Posts
                  Just do this:

                  Create a snippet called my tv with the following code:

                  
                  return "[*tvnamegoeshere*]";
                  
                  


                  and call that snippet uncached. That should be a quick workaround for your problem until someone comes up with a better way.
                    • 30095
                    • 9 Posts
                    It’s a good trick, and works fine! Thank you