We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37521 ☆ A M B ☆
    • 30 Posts
    I'm learning plugin writing in MODx Revolution and so I have question: In my plugin I want to get some fields of panel when new Template is creating. For example, the name of the template. So this name while typing would appear in the field "static file name" if the checkbox "Static" is checked. But the problem is that I don't understand how to get these fields via js.
      • 37521 ☆ A M B ☆
      • 30 Posts
      Is anybody here? smiley Or my English is so bad and nobody understand what I want sad
        • 37521 ☆ A M B ☆
        • 30 Posts
        :(
          • 22427
          • 793 Posts
          It's not clear what you want to achieve - obviously to others too, because you didn't get an answer to the same question on stackoverflow.
          A Google research finds the term "MODx.panel.Template" only as a class definition in the japanese project modx-revo-ja by yama - I don't know what this is, some fork of Revo?
          So you could try to put your question there.
            • 37521 ☆ A M B ☆
            • 30 Posts
            Ok... let I try to explain by steps.
            1) Login to Modx Manager
            2) Go to Elements -> Templates -> create new template
            3) Now we have a panel for creation new template as in image
            4) How to get and set values of fields Name, Description, Is static and so on?
            5) How to catch events when these fields are being changed?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Are you trying to set up a custom template creation form?
                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
                • 37521 ☆ A M B ☆
                • 30 Posts
                I'm trying to create plugin on event OnTempFormRender, OnChunkFormRender and so on. It will set appropriate Media Resource and file name when I click checkbox "Is static".
                  • 3109 ☆ A M B ☆
                  • 894 Posts
                  If you want to change the name of fields you can do that with form customization try checking out my Form Customization tutorial on CMSTricks
                    Benjamin Marte
                    Interactive Media Developer
                    Follow Me on Twitter | Visit my site | Learn MODX
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    I think what he wants is to automatically assign (or even create?) a file and a media source when creating a static template. That would take some pretty tricky manipulation of the template editing form. I don't think there's an easy way to do that.
                      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
                      • 37521 ☆ A M B ☆
                      • 30 Posts
                      Yes, only assign. If for example my Template name is MyTemplate then if I check Is Static the file name in appearing edit input has already set as MyTemplate.php or other extension that set in the system settings. Same as for media resource. One time to set in system settings relations TemplateMediaResource - Template, ChunkMediaResource - Chunk and so on, and I don't need to set them every time when I create new Elements.