We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16429
    • 254 Posts
    Moderator’s note : This topic has been split from Project: MODx Customer Backend

    Quote from: davidm at Apr 07, 2008, 03:28 PM

    [...]with 0.9.7 since the backend will be way easier to customize thanks to Smarty powered backend and ext2.0 as js framework.[...]

    OMG no... I always dream of a Manager stylable with MODx template system... I hate Smarty >:(
    Why having 2 templating system in the same CMF? I want to use snippets and plugins, design the page with [*tags*] and [*tvs*], have a "manager relationship tree" where I can manage the position of pages or add other pages...
    Hell, no, Smarty no :’(
      kudo
      www.kudolink.com - webdesign (surprised?)

      [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
      • 6726
      • 7,075 Posts
      My understanding is, MODx will ship with Smarty for the backend, but you’re not bound to Smarty you can use another template system if you so wish. I think there was technical reasons behind this choice, Smarty integrating seamlessly with the new codebase.

      But this goes well beyond my grasp, so I’ll let devs jump in and give additionnal info !



        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 4971
        • 964 Posts
        +1 against Smarty
          Website: www.mercologia.com
          MODX Revo Tutorials:  www.modxperience.com

          MODX Professional Partner
        • I feel the same way about frames, and yet I’d gladly take the frames in the MODx manager any day over pretty much any other alternate.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • +2 against Smarty
              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
              • 28436
              • 242 Posts
              hey folks

              why against smarty? its one of the world finest stuff... give it a serious try and you will love it.

              nice plugin|modifier-system {$pagetitle|replace:&:&}
              direct access to post,get,session values {if smarty.session.login}you Logged in{/if}
              loop arrays in Template {foreach} do loop {/foreach}
              run "inline-php" code {php}echo ’hello world’; {/php}
              nice caching functions.... and many more...

              I use smarty for my own snippets because i havent the power to create such a template-parser and sometimes i wish all of you guys/and girls use smarty for your snippets as well. Same base for all. Sorry, but all this selfmade stuff around is not able to fight/beat smarty.

              Attention: this is just my opinion and i will accept all other.

              bye, Stefan
                • 20289
                • 958 Posts
                Never tried smarty template engineering but seems very heavy structural that i can’t get in its hearth!
                  [img]http://i10.tinypic.com/52c4eir.gif[/img][/td]
                  [td][Wiki] [Persian support forum]
                  [SVN] [RTL SVN Branch] [bugs] [FishEye+Crucible] [Learn MODx!] | [My Google Code]
                  [font=tahoma][برای دسترسی به راهنمای فارسی به [url=http://www.modxcms.ir]
                  • 6726
                  • 7,075 Posts
                  I think we need some dev perspective on the Smarty item, I am not a big fan but I have gotten a chance to get familiar with it and it’s not that bad : come on guys it’s a progress from the current manager !!! If anyone wants another template engine for the new core, I might be wrong but I think you can build it. You don’t like Smarty ? Let’s get to work folks tongue !!!

                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l'outil id
                    • 28436
                    • 242 Posts
                    Hey man,
                    but seems very heavy structural that i can’t get in its hearth!
                    don’t be afraid of it. Try it. It can be so easy and simple.. and otherwise so powerfull and (your right) heavily complex.

                    ok, i will try to give you a sample.

                    you want an output like this
                    <div>
                        <h1>title</h1>
                       
                        <div>
                            <h3>title 1</h3>
                            <p>some text for the first entry</p>
                        </div>
                    
                        <div>
                            <h3>title 2</h3>
                            <p>some text for the second entry</p>
                        </div>
                    
                    </div>
                    


                    the source is an array like this
                    <?php
                    $data = array(
                        0 => array(
                            'title' => 'title 1',
                            'text'  => 'some text for the first entry'
                        ),
                        1 => array(
                            'title' => 'title 2',
                            'text'  => 'some text for the second entry'
                        )
                    );?>
                    



                    By the selfmade-way you need two templates
                    outer_tpl:
                    <div>
                        <h1>Title</h1>
                        [+inner_output+]
                    </div>
                    


                    inner_tpl:
                    <div>
                        <h3>[+title+]</h3>
                        <p>[+text+]</p>
                    </div>
                    


                    than you need the logic to handle the templates and source.
                    <?php
                    function myReplaceFunc( $tpl, $data )
                    {
                        foreach( $data as $ph => $val)
                        {
                            $retval = str_replace('[+'.$ph.'+]',$val, $tpl);
                        }
                        return $retval;
                    }
                    
                    $inner_output ='';
                    $inner_tpl      = file_get_contents( 'inner_tpl' );
                    foreach( $data as $dataset )
                    {
                        $inner_output  .= myReplaceFunc($inner_tpl, $dataset );
                    }
                    $output ='';
                    $outer_tpl = file_get_contents( 'outer_tpl' );
                    $output   .= str_replace('[+inner_output+]', $inner_output, $outer_tpl );
                    
                    return $output;
                    ?>


                    often it looks like that or similar like that.... or completely different.. anyhow, the way to doing this is similar... ok, this kind of bullshit is really _not_ a sample for nice code. But good enough to show "how to breaking fingers".

                    Ok, i don’t know what you think, but i am can imagine how to waste my time by doing some sweeter things.

                    The smarty-way is much easier

                    <?php
                    $smarty->assign( 'data', $data );
                    $smarty->display( 'tempate' );
                    ?>


                    Template
                    <div>
                        <h1>title</h1>
                        {foreach from=$data item=i}
                            <div>
                                <h3>{$i.title}</h3>
                                <p>{$i.text}</p>
                            </div>
                        {/foreach}
                    </div>
                    


                    wow! how fast is it! And you have much more "built-in"-possiblities in the template. MuchMore as everyone of us could provide without spending hundreds of hours to build up an template-engine. Thats the reason why i am vote for smarty.

                    bye, Stefan

                    PS: sorry for my horrible english-spelling and i wont to decry the work of anyone.

                      • 29181
                      • 480 Posts
                      I don’t like Smarty either, after spending much too long messing around with a modified xt:commerce template.

                      I am not particularly against it, but would like to know what the alternatives are wink

                      Current changes to the manager are very difficult to undertake, other than making elements disappear with managermanager.
                        Adrian Lawley: www.adrianlawley.com