We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    In 0.9.7, It’s better to start using modOutputFilter instead of phx even if you could use it IMO.. takes off alot processing overhead and we can get the bugs ironed out sooner than later..


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: doze at Feb 26, 2007, 09:32 AM

      In 0.9.7, It’s better to start using modOutputFilter instead of phx even if you could use it IMO.. takes off alot processing overhead and we can get the bugs ironed out sooner than later..
      phX will not work in 0.9.7 period; this is why modInputFilter and modOutputFilter were created, so replace phX functionality for 0.9.7. Because of the ways in which the new parser works, the former phX approaches are no longer valid ways to apply these modifiers to placeholders.

      modInputFilter is called by every tag element before it is processed; modOutput filter is triggered after the content is returned by the tag element and before it attempts to process any additional tags that may have been returned by that element.

      And as I said before, if you want to help get modInputFilter and modOutputFilter working, that would be stupendous; I need as much help as you can spare to help get 0.9.7 up to speed as quickly as possible. smiley
        • 33337
        • 3,975 Posts
        In Manage Resources, when editing a template, "Template Name" isnt pre-populated.
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 27376
          • 576 Posts
          I’ve taken another look 0.9.7 (checked out rev2431 from braches/opengeek/trunk) and I’m quite impressed.

          The conversion of my website of 405 documents went smoothly and the manager works.

          Couple issues:
          Weblinks do not work at all. It outputs the id of the document it should be linking to.
          Template Variables return "Array" as the output.

          I thought I’d take a look at the source code to try to fix the TV returning "Array" and I was awestruck at the complexity of it. After almost 30 minutes of tracing, I managed to print_r the array:
          Array ( [0] => sidebar [1] => Hello? [2] => htmltag [3] => &width=100&height=100&borsize=1&format=Upper Case&tagname=div [4] => textareamini )
          It would seem the TV isn’t being passed through the widget parser or something ( I temporarily changed the widget to ’HTML Generic Tag’ it used to be un-used (no widget))....

          Is this enough info, Jason?
            • 22303 MODX Staff
            • 10,725 Posts
            Quote from: sirlancelot at Mar 12, 2007, 07:48 PM

            I’ve taken another look 0.9.7 (checked out rev2431 from braches/opengeek/trunk) and I’m quite impressed.

            The conversion of my website of 405 documents went smoothly and the manager works.
            Great news; thanks for digging in and giving it a try...

            Quote from: sirlancelot at Mar 12, 2007, 07:48 PM

            Couple issues:
            Weblinks do not work at all. It outputs the id of the document it should be linking to.
            Template Variables return "Array" as the output.

            I thought I’d take a look at the source code to try to fix the TV returning "Array" and I was awestruck at the complexity of it. After almost 30 minutes of tracing, I managed to print_r the array:
            Array ( [0] => sidebar [1] => Hello? [2] => htmltag [3] => &width=100&height=100&borsize=1&format=Upper Case&tagname=div [4] => textareamini )
            It would seem the TV isn’t being passed through the widget parser or something ( I temporarily changed the widget to ’HTML Generic Tag’ it used to be un-used (no widget))....
            Yep, though I think by centralizing all the logic in modTemplateVar class, we can now simplify that complexity. I’ll take a look at these issues, but I would bet they are related to specific widgets (which I never use, explaining why they aren’t tested and working properly) tongue
              • 27376
              • 576 Posts
              Quote from: OpenGeek at Mar 13, 2007, 01:00 PM

              I’ll take a look at these issues, but I would bet they are related to specific widgets (which I never use, explaining why they aren’t tested and working properly) tongue
              The problem also came up when I wasn’t using a widget at all. I don’t use widgets either but I thought I’d try one to make sure that not selecting a widget wasn’t the problem.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Just upgraded my site to rev 2461. Manager gave me an error that the function __construct didn’t exist:

                class modSmarty extends Smarty {
                    var $modx= null;
                    
                	function modSmarty(& $modx, $params= array ()) {
                		$this->__construct($modx, $params);
                	}
                	
                	function __construct(& $modx, $params= array ()) {
                		parent :: __construct();
                        $this->modx= & $modx;
                

                Now I don’t know much about Smarty except that I don’t like it, and am sorry to see it being used here. However, I took a look at the included Smarty.class.php, and it doesn’t have a constructor named __construct, but its constructor is named Smarty. So I changed the above to parent::Smarty() and got the manager up OK. However, the front end is not at all happy...
                Warning: ksort() expects parameter 1 to be array, null given in /home/sites/sottwell.com/public_html/core/model/modx/modx.class.php on line 1525
                Warning: Invalid argument supplied for foreach() in /home/sites/sottwell.com/public_html/core/model/modx/modx.class.php on line 1526

                I’ll pick through the template and fix all the tags, as soon as I can find the documentation for what the tags are supposed to be now; maybe that will even fix the errors at the top.

                Ok, did that. Saving a chunk produces the "are you sure you want to leave this document without saving it" dialog, although the chunk is saved. I’ve changed the internal links in the home page, and cleared the site cache, but the original link forms are still there; not sure how since I don’t see any cached files in the cache directory. The page content is changed in the database; closing and reopening it shows the changes.

                Wayfinder snippet causes server 500 error huh even just a plain [[Wayfinder]] call. I turned off friendly URLs and removed the .htaccess file to make sure.

                So I’m going back to the earlier rev. This one definitely isn’t working for me.
                  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
                  • 7923
                  • 4,213 Posts
                  I’m not too happy about seeing Smarty either.. Here’s quick info why it’s there:

                  19:36 <     doze`> why do i see smarty in the commit logs.
                  19:36 <@ opengeek> rofl
                  19:37 <@ opengeek> because we are expermenting with using smarty to produce 100% customizable manager themes for 0.9.7            
                  19:39 <@ opengeek> just as one possible approach, you could also build a theme with the regular MODx parser, but I wanted to      
                                     have physical files for a "default" manager that could not be "messed up" by dumping the db                     
                  19:39 <@ opengeek> the more important part is all the processors will now be separate from the presentation, so you can submit
                                     content management requests from any context
                  19:40 <   jon1012> opengeek: if you use smarty, try template inheritance
                  19:40 <@ opengeek> all AJAX accessible and complete with error messages
                  19:40 <   jon1012> opengeek: I can send you the holdiland templates to see how it works
                  19:41 <@ opengeek> cool, yeah, shaun implemented this yesterday and today... it works wonderfully and the markup is instantly
                                     XHTML compliant and to create a completely custom manager is a matter of copying the templates and modifying
                                     them
                  19:42 <   jon1012> hehe
                  19:42 <   jon1012> well, with inheritanced no need of dcopying
                  19:42 <   jon1012> never write the same line twice :)
                  19:42 <@ opengeek> yeah, I think he has it setup that way, but will confirm
                  19:42 <   jon1012> I don't like the include top, include footer, etC...
                  19:43 <   jon1012> with inheritance, you define zones, then call a template that will show them... but that template can do the
                                     samer with an upper-level template...
                  19:44 <@ opengeek> well, here, the outer template is the modx controller (index.php) and is simply using a modSmartyParser class
                                     to render the page templates
                  19:44 <   jon1012> ok
                  19:45 <@ opengeek> next step is to break the framed model down into the theme as well (i.e. can delgate to theme-specific
                                     controllers or outer templates)
                  


                  I trust that any decision Jason makes is for the best.. although I was really amazed to see Smarty being used in core, another processing layer and syntax.. It would be possible to do 100% MODx own templates with snippets and input/output filters for manager and still be fully customizable, but I understand it would be a lot more work to do.

                  I think this Smarty business deserves it’s own topic.. smiley Anyone with rights, feel free to split this if you agree.


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Keep in mind folks that that’s for the Manager only. Unless you’ve got hundreds of concurrent manager users, I don’t think you’ll be able to notice any degradation whatsoever in performance or notice any extra overhead. Also, keep in mind that it also means that the manager pages are now written in MODx itself. It certainly doesn’t introduce Smarty as a requirement for front end stuff. Similarly, you could just as easily create a manager theme that uses Tiny But Strong (TBS), MODx native functions (though there’s still no recursive display blocks or conditional templating logic in the default parser, hence Smarty as the first demo).

                    And finally, even though I’m not a fan of smarty myself, doesn’t mean that there aren’t a boatload of folks that are, and it really will provide yet another marketing opportunity for MODx. By the time 097 is actually released, I suspect we’ll have a native parser with conditional templating that allows a total rewrite of the manager to occur in a similar timeframe (24 hours). I certainly hope we don’t have frames!
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 6726
                      • 7,075 Posts
                      Amen to that Ryan !

                      I sure shuddered at the mention of Smarty but I understand the reasonning behind using it for the manager... though, if I understand correctly one of the main incentive to use smarty is to have files versus templates stored in DB for the obvious reasons Jason mentionned.

                      I know it’s easier said that done, and that there is a way to use files already, but wouldn’t it be nicer - ultimately - to have the current templating system evolve and offer an easy way to use files as an alternatives to DB ?

                      Last but not least, I recall a debate between Raymond and Jason about conditionnals in (or not in) the parser, Raymond being for it and Jason against it (sorry it was technical I can’t recall the whole thing but it had to do with separating logic from the parser) : where do we stand for the future ?

                      I mean, PHx is there alright but will need some rewriting to work with 0.9.7, and for me it means standby on implementing PHx till I know it’s the way to go...
                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l&#39;outil id