We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16183
    • 1,390 Posts
    Quote from: BobRay at Aug 15, 2009, 08:23 PM


    That said, here are a few examples (from the book wink):

    Is this *THE* book (you’ve been working on)? When is it coming out....when Revo RC comes out?

    Hmmm . . . let me guess. Wink

    Miles away..don’t hold your breath wink

    cheers/k
      • 3749
      • 24,544 Posts
      Quote from: kongondo at Aug 15, 2009, 08:41 PM

      Quote from: BobRay at Aug 15, 2009, 08:23 PM


      Is this *THE* book (you’ve been working on)? When is it coming out....when Revo RC comes out?
      Yes. It’s coming along. I can’t say when it will be available -- hopefully some time this Fall.

      It’s currently at about 350 MS pages in Word and growing daily. I should be working on it right now. wink
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 16183
        • 1,390 Posts
        Quote from: BobRay at Aug 15, 2009, 08:56 PM

        Quote from: kongondo at Aug 15, 2009, 08:41 PM

        Quote from: BobRay at Aug 15, 2009, 08:23 PM


        Is this *THE* book (you’ve been working on)? When is it coming out....when Revo RC comes out?
        Yes. It’s coming along. I can’t say when it will be available -- hopefully some time this Fall.

        It’s currently at about 350 MS pages in Word and growing daily. I should be working on it right now. wink


        That’s pretty soon (fall)....all the best!

        cheers/k
          • 3749
          • 24,544 Posts
          Quote from: kongondo at Aug 15, 2009, 09:04 PM

          That’s pretty soon (fall)....all the best!
          cheers/k

          Well, I’m using the term "fall" quite loosely and I did say "hopefully". wink
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 29635
            • 361 Posts
            Quote from: OpenGeek at Jul 28, 2009, 03:01 PM

            since it was built to avoid these combinations of logic and presentation. TBH, you might as well use plain PHP, or JSP, or ASP if you want to circumvent this important MVC goal.

            Fwiw, I agree that PHx can certainly be abused. I see many new MODx users go down the "make everything one template and use dozens of TVs to control the output", just like the "use one template and have tons of PHx in there to presentation." But imo the main reason PHx _can be_ so great is because you don’t have to worry about nesting snippets within snippets, as the whole snippet nesting business can only go 2 levels. (Right? Or have things when I wasn’t looking?)

            That said, I do agree with Charlie about if/else statements being _extremely_ useful. I’m not going to argue against MVC principles, but imo it’s just so much easier and more maintainable to use PHx for a quick bit of logic (as it relates to presentation) than it would be to write a snippet, create two or three chunks (that potentially have additional snippets inside them), and then put it all in the template. I mean, I get that splitting it all up is more proper, but the reality is that if I’m going to need to change the logic _or_ the presentation down the road, odds are I’m going to be rebuilding both at the same time anyway. And, as mentioned, nesting snippets gets squirrely.

            I’ve seen a lot of discussion about this idea with CSS lately as well. Yeah, using a grid system and giving classes like .grid_6 isn’t proper, but the reality (imo) is that if you find yourself in the situation where you’re needing to substantially change the layout, you’re likely going to be rebuilding (at least some of) the HTML anyway. CSS Zen Garden is great, but in the day to day business of building websites and systems...

            Anyway, just my opinion. I’m only chiming in because I’m interested in where people stand and how people address basic template logic without PHx.
              Need MODx Ecommerce? Try FoxyCart!
              • 20413
              • 2,877 Posts
              I love PHx, I would hate it if I was forced to use it as the only option. But no, it’s with love I use it everyday in my placeholders. kiss
              It breaks if trying to return kilobytes of text with it(!)
              http://modxcms.com/forums/index.php/topic,36195.msg227747.html#msg227747

              For short values and implementing PHP Thumbs to Maxigallery - PHx rocks.
              Much of the PHP I learned is thanks to writing PHx modifiers.
                @hawproductions | http://mrhaw.com/

                Infograph: MODX Advanced Install in 7 steps:
                http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
              • Like any tool, PHx can certainly be abused. But it does have it’s uses and the convenience of just hammering through quickly and getting things done can sometimes outweigh the proper ways of doing things and strict adherence to MVC principals. If you need more robust conditional templates, use snippets or one of the established template systems like Smarty (which we use in the Manager for Revo extensively).

                I would certainly advocate knowing the rules really well before breaking them. Granted, the if/then/else ability in PHx is quite handy and terribly tempting frequently. The pure data format filters are incredibly handy, too (date formatters, formatting numbers to two decimals, etc.).
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me