We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46434
    • 22 Posts
    How do you get the default value for a rich text template variable? Clicking on the "Set do default" button doesn't seem to do anything. Is there something special I need to do when creating the rich text tv?
      • 46434
      • 22 Posts
      Anybody?
        • 3749
        • 24,544 Posts
        Did you put something in the Default Value field (on the Input Options tab) when editing the TV itself (not a resource), then save the TV?
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 46434
          • 22 Posts
          Yes. I have an instance of ModX 2.3.1 running on modxcloud. I just confirmed that there is a default value for the tv (input options tab). When I go to any resource and press the "Set to default" button for that tv, nothing happens. I am unsure if this is a bug, or if I am missing a step when creating a rich text tv. Are you able to reproduce this?
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Using Redactor, the rich-text editor type TV does show the default value on my localhost 2.3.1 installation.
              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
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Um... I have a question. What "set to default" button?

              Ah, I found it. It's a mouse hover thing.

              Ok, it doesn't do anything in a Rich Text field. However, if the resource's Rich Text checkbox is cleared, then it does work as expected.

              It also works if you refresh the browser - it may warn you about leaving the page, go ahead and leave the page.

              It also works if you use the "html" view/window of the rich text editor. [ed. note: sottwell last edited this post 11 years, 11 months ago.]
                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
                • 46434
                • 22 Posts
                Ok, it doesn't do anything in a Rich Text field.
                ^ this is what I am referring to.

                The default value does display initially, however if the content of the rich text TV (in the resource) is changed, and then the "Set to default" button is pressed, the content in the TV is not restored to what was defined as the default value.

                To re-iterate...If the content in the rich text TV (in the resource) is cleared, and the page refreshed, it does repopulate with the default value, however if the content in the rich text TV is changed (you make it bold, for example), and then want to restore the TV content to the default value, the button does not work. Clearing the content and refreshing will do the trick, however that is only a workaround to what I believe is a bug. Also a client with no-development experience would perceive this feature as "not working", unless specifically instructed to use the clear-and-refresh workaround for rich text TVs.

                Can you confirm this behavior? If so, I believe it is a bug, and will submit it as so on github.

                If you can confirm my finding with TinyMce, do you experience the same thing using redactor, or does the "set to default" button with the redactor editor work as expected? I do not have redactor to test this case.