We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40616
    • 11 Posts
    Hi there i'm writing a plugin for automatically convert chunks, snippets and templates to static resources
    I want to add my check to the right pane below the static checkbox


    >>> HERE MY CHECKBOX <<<

    Thanks in advance!
    Juan
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Careful here; static resources are another matter altogether. These are static elements. It could get very confusing if the two aren't understood to be different things altogether.

      As far as I know, there is no feature to customize any of the element form pages, as there is for Form Customization for resources. But I may be wrong about that...

      http://rtfm.modx.com/display/revolution20/Customizing+the+Manager#CustomizingtheManager-WhatFormscanICustomize%3F

        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
        • 40616
        • 11 Posts
        Right I meant elements! (but aren't elements resources to templates or other elements?) that's what I'm doing, since convert to static is a 3 steps process I'm trying to automate (I already have but I wanted to make it more general)

        Form customization is not only for resources check out all that events in the events tab!

        Quote from: sottwell at Nov 16, 2012, 10:28 AM
        Careful here; static resources are another matter altogether. These are static elements. It could get very confusing if the two aren't understood to be different things altogether.

        As far as I know, there is no feature to customize any of the element form pages, as there is for Form Customization for resources. But I may be wrong about that...

        http://rtfm.modx.com/display/revolution20/Customizing+the+Manager#CustomizingtheManager-WhatFormscanICustomize%3F

          • 33968
          • 863 Posts
          I don't think you need to add another checkbox, you already have 'Is Static'.

          Just set your plugin to run on the 'OnChunkSave', 'OnPluginSave', 'OnSnippetSave' events and in your code check if 'static' is set to true. If it is, then you can check to see if the static element already exists on the filesystem, and if not create a new file. [ed. note: okyanet last edited this post 13 years, 10 months ago.]
            • 40616
            • 11 Posts
            ...of course but i want to:
            1 create a file with the same name in /assets/$type (chunk, snippet,template,plugin)
            2 make the chunk, snippet,template,plugin static
            3 assign the file created to the propper field

            all this to automate the process of converting.

            ...anyways thank for trying help!

            Quote from: okyanet at Nov 18, 2012, 07:13 AM
            I don't think you need to add another checkbox, you already have 'Is Static'.

            Just set your plugin to run on the 'OnChunkSave', 'OnPluginSave', 'OnSnippetSave' events and in your code check if 'is_static' is set to true. If it is, then you can check to see if the static element already exists on the filesystem, and if not create a new file.