We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    The question mark is only needed if there are parameters; it works just like the query string in a URL.
      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
      • 33372
      • 1,611 Posts
      Just quickly looking over the code, I think that that the problem here is that the placeholder is being cached (even though the snippet is not). So you’d either have to make the whole page uncached or have the snippet return the code that you are currently setting as a placeholder (i.e., the CSS font size declaration) and put the snippet in your template where you now have the placeholder. I guess you could also have another uncached snippet that returns the value of the placeholder, but that would really only make sense if the placeholder were set somewhere else (e.g., a plugin).
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 21257 MODX Staff
        • 730 Posts
        @ZAP - wow, I didn’t even know that placeholders could get cached independent of the snippet that sets them. Is this documented somewhere? I didn’t mean to cause this much confusion with a little example snippet. I should definitely figure this out before I strike again ;-)
          Mike Schell
          Lead Developer, MODX Cloud
          Email: [email protected]
          GitHub: https://github.com/netProphET/
          Twitter: @mkschell
          • 33372
          • 1,611 Posts
          Quote from: netProphET at Dec 07, 2007, 12:14 PM

          @ZAP - wow, I didn’t even know that placeholders could get cached independent of the snippet that sets them. Is this documented somewhere? I didn’t mean to cause this much confusion with a little example snippet. I should definitely figure this out before I strike again ;-)
          I don’t know that it is documented, but it’s something that I’ve stumbled across over time (I say stumbled because I also assumed that they would always be uncached rather than cached). I think that placeholders are just treated the same as chunks when the document parser creates cache files, so they get cached on the first page load and then never change again unless you clear the cache. I’ve had to create uncached snippets that just return placeholder values in the past, and that’s worked for me.
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn't very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 23019
            • 27 Posts
            If I’m using it well and, according to netProphET’s words, placeholders can’t be cached or uncached independently... Then, what is the reason of this?
              • 10226
              • 412 Posts
              I have used this as well - and it is fairly simple and clean. I haven’t found any bugs or issues. At first I was not convinced it would work well but it has. *two-thumbs-up*

              Don’t know how I ended up on this site ( http://www.the-american-interest.com/contd/ ) but I dig the interface - not the position, the idea.

              In addition to sizing the font more than one level, you can cycle through typefaces. it is js as I thought, and probably something more.

              Just wanted to share!
                • 33372
                • 1,611 Posts
                Quote from: Pepest at Dec 10, 2007, 04:20 AM

                If I’m using it well and, according to netProphET’s words, placeholders can’t be cached or uncached independently... Then, what is the reason of this?
                You probably have the page uncached.
                  "Things are not what they appear to be; nor are they otherwise." - Buddha

                  "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                  Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                  • 21257 MODX Staff
                  • 730 Posts
                  Quote from: Pepest at Dec 10, 2007, 04:20 AM

                  If I’m using it well and, according to netProphET’s words, placeholders can’t be cached or uncached independently... Then, what is the reason of this?

                  Just to be clear, I was saying that I didn’t know that this could happen. Not saying it can’t happen. I’m still not sure about it.
                    Mike Schell
                    Lead Developer, MODX Cloud
                    Email: [email protected]
                    GitHub: https://github.com/netProphET/
                    Twitter: @mkschell
                    • 10226
                    • 412 Posts
                    I just noticed that this sticks a "1" in my <head> right before required <style> tag.

                    Any ideas?
                      • 33372
                      • 1,611 Posts
                      Quote from: fruitwerks at Dec 10, 2007, 07:04 PM

                      I just noticed that this sticks a "1" in my <head> right before required <style> tag.
                      Does your snippet end with just return;? You should always return some value from a snippet to avoid seeing text like this (a 1 means the snippet was executed, afaik). Change it to return ’’; (an empty string).
                        "Things are not what they appear to be; nor are they otherwise." - Buddha

                        "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options