We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    Here’s what I propose for the new manager templating system:

    Template path:

    manager/themes/{name}
    manager/themes/{name}/images
    manager/themes/{name}/login.php - login page
    manager/themes/{name}/layout.php - master page layout
    manager/themes/{name}/{other_manager_pages}.php - action page templates
    manager/themes/{name}/style.css


    example of layout.php

    <?php 
    	$info			= array();
    	$info['name'] 	= 'BlueWater';
    	$info['date'] 	= '09-Nov-2005';
    	$info['author']	= 'modxer';
    ?>
    <html>
    <head>
    <style>
    	@import([+themepath+]/style.css);
    </style>
    <script src="[+themepath+]/setfooter.js"></script>
    </head>
    <body>
    <div id="cms_container">
        <div id="cms_header">[+header+]</div>
        <div id="cms_menu">[+menu+]</div>
        <div id="cms_sidebar">[+panels+]</div>
        <div id="cms_content">[+content+]</div>
        <div id="cms_footer">[+footer+]</div>
    </div>
    </body>
    </html>


    The template engine should be able to process Placeholders and Plugins

    example of {other_manager_pages}.php

    <div class="cms_buttons">[+save+] [+delete+] [+cancel+]</div>
    <div class="cms_form">
    	<form action="index.php?a=[+action+]">
    		[+trig:OnFormPreRender+]
    		User name:<input name="name" type="text" value="[+username+]" />
    		<input name="send" type="submit" value="[+lang:submit+]" />
    		[+trig:OnFormRender+]
    	</form>
    </div>



    Note the new placeholder pre-processors [+lang:{language-name}+] and [+trig:{event-name}+]

    We could also do something like [+site:email_address+]
      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 25663 MODX Staff
      • 12,272 Posts
      Now that looks great Raymond!

      In the other page example above, can you explain the preprocessors a little and how they work?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 1764
        • 680 Posts
        Looks good to me too. My one concern is how using a lot of snippets/chunks/plugins in the manager will affect the frontend performance and bog down the manager UI for snippet/chunk/plugin editing. I think we need to to do some testing for performance reasons and maybe we need to have a way to hide manager snippets/plugins/etc to the common user, maybe based on permissions.
          • 25663 MODX Staff
          • 12,272 Posts
          Ahhh... how Shakesperian... a snippet within a snippet!
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 32963
            • 1,732 Posts
            Quote from: rthrash at Nov 09, 2005, 06:40 AM

            Now that looks great Raymond!

            In the other page example above, can you explain the preprocessors a little and how they work?

            Ok maybe preprocessor was not the right word to use but I could not come up with anything else.

            The general idea here is that these special placeholders such as [+lang:+] will be be parsed as normal placeholders would but they would return the value from some predefined process.

            For example, the [+lang:{name}+] placeholder will return the language for the given {name}.

            When the parser encounters the [+lang:login_message+] placeholder it will look up the language key (or name) "login_message" and then return the following to replace the placeholder:

            Please enter your login credentials to start your Manager session. Your username and password are case-sensitive, so please enter them carefully!

            When the parser sees the [+site:email_address+] it would then lookup the site settings "email_address" and return that value.

            Whenever it encounters the [+trig:OnFormPrerender+] placholder it will trigger the event "OnFormPrerender" and return the output from the event.

            What do you think?


              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 25663 MODX Staff
              • 12,272 Posts
              That sounds great to me. Something I’d really like to address is the internationalization and extending it to the front-end too. I do recall that this is one of the things Travis did have working using the syntax of %%(word/phrase goes here)%% or something like that, anyway. It was all done using i18n (or whatever that is) and some sorta mojo there. This is where some of the guys from France and the Netherlands could really help out I’m sure.

              And we should probably prepare for the inevitable "in the database" vs the "on the filesystem" debate here... which if you think about it also applies to many other things we’re doing! wink
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 25663 MODX Staff
                • 12,272 Posts
                Actually now that I think about it also, I’m in favor of making all the actions in the template directories to be overrides, and only used if they are present. I’m confident we can build a default set with enough "hooks" in them to satisfy most developers’ needs. They can still change the layout and look via CSS quite easily.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 32963
                  • 1,732 Posts
                  Quote from: aNoble at Nov 09, 2005, 07:16 AM

                  Looks good to me too. My one concern is how using a lot of snippets/chunks/plugins in the manager will affect the frontend performance and bog down the manager UI for snippet/chunk/plugin editing. I think we need to to do some testing for performance reasons and maybe we need to have a way to hide manager snippets/plugins/etc to the common user, maybe based on permissions.


                  Ok,

                  The design of the parser will also be changed a bit to handle hundreds of plugins. We would very well allow some plugins to only execute from withing the manager or visa versa. But that’s something we will have to agree to.

                  The next thing is that we could tag (or categorize) manager plugins within some built-in tags so has to group those built-in plugins.

                  IMO I don’t think the snippets will slow down the manager any more than they would a website. Template designers just have to make sure that they don’t over do things. The other thing is that the manager’s UI will not have any effect on the performance of the frontpage.

                    xWisdom
                    www.xwisdomhtml.com
                    The fear of the Lord is the beginning of wisdom:
                    MODx Co-Founder - Create and do more with less.
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Victor has some insights on general design/coding patterns for handling plugins which I hope he’ll contribute here.

                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 1764
                      • 680 Posts
                      This all sounds great to me! I love the placeholders idea.

                      Do you think we should implement some sort of caching in the manager? I think it would be very helpful for the language placeholders, especially.