We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36425
    • 49 Posts
    I need to change by the plugin - template static file, is this possible?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I need more information. This appears to be a static template, I don't read Russian but it looks like it.

      The template's actual content should be below that, and you can edit it there and the file will be saved.

      You can also edit it using the Files tab in the Tree on the left of the Manager.

      Or you can use FTP/SFTP to download it, edit it, then upload it, or use SSH and edit it with a console editor like vi or emacs.
        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
        • 40045
        • 534 Posts
        If you get a template object of a static template with (you can do that in the plugin):

        $tpl = $modx->getObject('modTemplate', array('id' => 7));
        


        then you get the following array:

        Array
        (
            [id] => 7
            [source] => 0
            [property_preprocess] => 
            [templatename] => StaticTemplate
            [description] => 
            [editor_type] => 0
            [category] => 0
            [icon] => 
            [template_type] => 0
            [content] => 
            [locked] => 
            [properties] => Array
                (
                )
        
            [static] => 1
            [static_file] => asstets/tpl.tpl
        )
        


        as you can see you have the fields "static" and "static_file", "static" should be used to check if it's really a static template (not to set a static file on a normal template) and then you can change the static file dynamically with:

        $tpl->set('static_file', 'path/to/new/static/file.tpl');
        $tpl->save();