We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8609
    • 607 Posts
    Quote from: Ynotmodx at Mar 18, 2009, 10:13 PM

    Thanks all for contributing. As i discuss here, I have opened up numerous forum threads to try and see what i can learn.

    @BobRay and OpenGeek

    When i design websites with .php extension as oposed to .html, i am able to include small bits of php scripts to the web page using require or include. Would that cause an error in modx? I am just looking at alternatives and not be fixated at the converting snippets issue.

    Most of the stuff you would put in includes can go in chunks, unless they have php code in them.
      • 3749
      • 24,544 Posts
      Quote from: Ynotmodx at Mar 18, 2009, 10:13 PM

      When i design websites with .php extension as oposed to .html, i am able to include small bits of php scripts to the web page using require or include. Would that cause an error in modx? I am just looking at alternatives and not be fixated at the converting snippets issue.

      It wouldn’t cause an error, but the php code would be ignored (making your site much more secure). In MODx, you would create a new snippet, give it a name, and paste the <?php code ?> into it. Then, you’d put a snippet tag (aka snippet call) where the code was: [[SnippetName]] or [!SnippetName!]. The second version is for when the snippet’s output will change and you don’t want it cached. Whatever is produced by the php code will appear where the snippet tag is.

      That said, if you have a lot of small php snippets scattered throughout your pages (I see this a lot lately in WordPress), your pages become very difficult to maintain because you have your code mixed up with your content. MODx not only allows, but encourages you to completely separate content from presentation code and logic.

      If you have a short example of what you’re talking about, you could post it here and perhaps get feedback about how best to do it in MODx.
        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
        • 33160
        • 24 Posts
        Thanks BobRay,

        I think I get the picture. What you mean in essence is that instead of adding a <?php include tag directly into the webpage/template, I could take that same include code and create a snippet adding the code to the snippet and then call it in the template where the php include code would have been, right? And that would do whatever the php include or require would have done , right?
          • 3749
          • 24,544 Posts
          Quote from: Ynotmodx at Mar 18, 2009, 10:51 PM

          Thanks BobRay,

          I think I get the picture. What you mean in essence is that instead of adding a <?php include tag directly into the webpage/template, I could take that same include code and create a snippet adding the code to the snippet and then call it in the template where the php include code would have been, right? And that would do whatever the php include or require would have done , right?

          Exactly right, although the way MODx does it, you can often make some optional improvements in the code that make it easier to maintain.
            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
            • 25803 ☆ A M B ☆
            • 721 Posts
            My PHP is weak. I’ve gone through some tutorials and understand the basics but I just don’t have the time to use it very often so out of practice equals out of mind.

            That said, I find that I can use MODx and it’s many extensions without knowing much PHP and rarely, if ever, having to do any programming. Take WebLoginPE. I was able to make an entire membership system, complete with custom fields, custom emails, etc., by using that snippet. Way beyond my programming skills.

            However, that said, it took me awhile to get MODx and things like the Wayfinder and Ditto. Once you get how it all comes together it’s quite impressive. I’m not going to say the documentation isn’t good as it is typical of documentation for Open Source projects and documentation written by programmers. But none of that addresses the way I personally learn and I suspect a fair amount of others.

            I used to write training manuals and teach courses about Flash (where I was pretty good with ActionScript but haven’t touched it in years), Dreamweaver, Photoshop, Illustrator, etc. I am very tempted to write a book about MODx but it would lack the PHP/API side of things but perhaps that documentation is much improved for Revolution and I’ll wait for Revolution official release before considering it again.

            I do wish there was an easy way (and there may be an easy way I’m not aware of) to include certain snippets, plugins, etc. that are not part of the default core install. ManagerManager is a given I’d say, but it’s not in .9.6.3. MaxiGallery is another, Sitemap, Analytics (particularly with the emphasis in marketing about SEO).

            Ditto is included of course, but it’s power and central functionality to MODx can easily be lost. I recently used Ditto in combination with ManagerManager to create an events system that will show event name, short description, dates, capacity in a table, and you can click through to see all the event details. In the backend, ManagerManager was used, with Template Variables, to make an Events tab where all the applicable information can be entered when using a certain Template.

            It seems that a lot snippets or plugins use templates (Ditto Templates, eForm Templates, WebLoginPE Templates), the document tree, roles, etc. Understanding the overall structure and how one item relates to another is essential. I’ve discovered that through trial and error and this forum.

            One of the better tutorials on the web that takes you through the process is here:

            http://net.tutsplus.com/tutorials/other/working-with-a-content-management-framework-modx/

            Going through this tutorial, I think, could potentially help one get up to speed.
              • 3749
              • 24,544 Posts
              Quote from: rx2 at Mar 18, 2009, 11:16 PM

              I do wish there was an easy way (and there may be an easy way I’m not aware of) to include certain snippets, plugins, etc. that are not part of the default core install. ManagerManager is a given I’d say, but it’s not in .9.6.3. MaxiGallery is another, Sitemap, Analytics (particularly with the emphasis in marketing about SEO).

              You’ll be happy to hear that in MODx Revolution 2.0, add-on components can be downloaded and fully installed with a few clicks in the Manager. I should qualify that by saying they *will* be installable that way once the someone (hopefully the author) creates a Transport Package for them.
                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
                • 34017
                • 898 Posts
                i hate writing. There i said it. but a good tutorial might be explaining how snippet parameters work compared to normal php files and joomla.

                <?php
                
                /* Normal php file */
                $parents = '14';
                $tpl = file_get_contents('myTemplate.tpl');
                include ('ditto.php');
                ?>
                


                /*Joomla module */
                
                $parents = trim( mosGetParam( $_REQUEST, 'parents', null ) );
                $tpl = trim( mosGetParam( $_REQUEST, 'tpl', null ) );
                
                //run Controller
                


                <!--Ditto: myTemplate would be a chunk -->
                
                [[Ditto? &parents=`14` &tpl=`myTemplate` ]]
                


                In php, you declare variables in the template code.
                In joomla, you have components and modules that allow you to choose variables
                in modx, you choose parameters with the &variable=`value` in snippets such as [[mySnippet? &var1=`var1_value` &var2=`vars2_value` ]]

                For simple php code, you may not need any parameters and can let the snippet just include a file. Example
                Create Snippet called "myTest"
                with the value
                <?php
                
                include ($modx->config['base_path'] . '/assets/snippets/myTest.php';
                
                ?>
                


                upload myTest.php to assets/snippets/myTest.php and put in the value
                echo 'myTest works. woohoo!';
                


                then call the snippet in any page via [[myTest? ]]
                  Chuck the Trukk
                  ProWebscape.com :: Nashville-WebDesign.com
                  - - - - - - - -
                  What are TV's? Here's some info below.
                  http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
                  http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
                  • 19975
                  • 429 Posts
                  Interesting post, I’m sure that more documentation and tutorials would not only help current modx developers but also act as a great marketing tool to encourage and introduce new users to modx. I personally hadn’t considered using modx before reading the article at http://net.tutsplus.com/tutorials/other/working-with-a-content-management-framework-modx/. However following Shane’s post I contributed a design proposal for the new Revolution admin interface and developed two major sites with modx.

                  So in short tutorials create a buzz, and are self feeding as new users join the modx community bringing additional valued contributes.

                  If we look at wordpress and all the spin and fan sites, while I’ve yet to build a custom site with wordpress I am a sucker for such sites as www.wpcandy.com, www.wpdesigner.com where I find inspiration for my design projects and find resources for my modx work.
                    Martin Sanders - Design & Web Development
                    • 27708 MODX Staff
                    • 2,502 Posts
                    @Ynotmodx

                    Thanks for your post. Almost 3 years ago I may have written a post that had some similar sentiments. There are many truths in there and some obvious frustration.

                    I am a web designer and front end developer (actually a marketer first and foremost) but MODx was the first CMS system that didn’t stand in my way of designing sites and creating implementations my clients could use.

                    As @rthrash notes we are focused on a narrow set of users but programming gurus not. Actually I think more web designers, like me, with cut-and-paste php use MODx than developers on a day to day basis. Out target user base are front end developers, designers, agencies and php developers. Our key target are not the install-and-write end user who might install Joomla or WordPress for that matter. That is not to say we couldn’t make it easier but we are far from ivory tower gurus; our expertise is in the collective. While there are a few people in the community who are code experts many people helping people are just like you but with a few small projects under their belt.

                    On your point about mass appeal: in business and marketing it is far better to have a small group of really dedicated customers, avid fans, or excited evangelists than many merely satisfied folks. People don’t get excited about fast food but do get excited about a fine restaurant experience. When people talk about MODx, they are often excited and love to share.

                    Yes, our documentation needs improving, yes we can shorten the learning curve some but it all takes time and resources. To be honest the key reason there are so many books/guides/tuts on some of the other CMSs out there is that they are overly cumbersome and complex or they want to appeal to that user set I mentioned: the install-and-add content folks.

                    The more time you spend here in the forums you’ll come to know that IT is MODxs greatest feature. The people here have gotten me through the learning curves, solving project problems and listened to me complain about what would make MODx better. There are no noob haters, no rude answers and if someone gives an explanation that is a little more advanced than you can understand usually they are willing to help you understand it.

                    I sincerely thank you for the time and effort that went into your analysis and hope that we can help you build your projects and hope you can help us make MODx better.

                    @modx Powered

                    You are right about the tutorials. We need more for sure. Shane’s article, in particular, has directed significant numbers to MODx and we know the value of such marketing exposure. You can’t pay for it you can only hope to create and cultivate an environment of passionate users who will be willing to share. WordPress fans are users who found a solution, shared experience and gave to the community (although have you ever tried posting something tot he WP support forums?) Many of MODxs users are professional or freelance folks who are using MODx on paid projects vs. the multitude of hobbyists and wannabe probloggers that comprise a significant share of WP users; people who have time to spend writing such articles because web design and development isn’t their income.

                    This is a terrific thread and I look forward to seeing other suggestions and comments.
                      Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
                      • 6726
                      • 7,075 Posts
                      Indeed interresting discussion which seems to be a recurring one, but I am surprised to see nobody object to the fact that modx is complex and requires advanced coding skills huh  modx is neither complex nor does it requires extensive coding skills !

                      Granted if you need to push a CMS to the limit and exploit its power, you have to be able to code php, but one of the things that attracted me to modx was that you can go further with modx without knowing php than any other CMS, period  cool  As it happens, my php is rudimentary and I have done some interresting stuff without php, things I wouldn’t have dreamed of with any other CMS.

                      I’d say modx is not complex but different, the same way textpattern is different and I recall many very similar discussions during my time there... Using tags to call snippets is a simple but powerful idea (txp use the same logic with plugins), because it’s way more efficient to learn a simple syntax a refer to a set of parameters than learn complex module admin and find your way back to a setting. Also, it fits naturally in a HTML page, also a tag based syntax though less powerful than modx’s. CMS Made Simple is an interresting case because it has one click features though it also has a tag syntax which is very easy to learn if you come from textpattern and fairly easy for any modxer. But CMS Made Simple suffers from a great lack : there is nothing close to TVs in modx or CCK fields in Drupal (last time I checked at least) and to me custom data structure is one essential key of content management.

                      Now that I had to work extensively with Drupal I think I have a nice insight at what makes modx different : I can adjust snippets parameters right in my templates of my chunk, I don’t need to go to the admin, pick the module, go to the settings, adjust, go back to my template (tiring, very tiring). Even the views module for Drupal which has a nice UI and basically has the same purpose Ditto has for modx, I find it much less efficient and it forces me into Drupal’s workflow rather than fit my workflow like modx does (and I find myself using the insertview module extensively, as it brings me back to a tag based syntax to adjust my views more easily). What’s true of Drupal is also (and probably more) true of many one click CMS.

                      One click CMS can implement thousands of features out of the box, but it takes a lot of work to customize the simplest element of design. On top of this, almost every answer to a problem in those CMS is... installing a module. You quickly end up with dozens of modules for a moderately complex website that would have taken no more than 10 modx addons. Why ? Because modx addons are like a lego kit : one modx addon can solve dozens of problems you face building a website feature. The fact that you can easily use the result output by an addon as a parameter for another addon opens many door. Flexibility improves how fast you can implement a website feature set and that is a key component of competitiveness. You have to experience this in real life projects to really grasp how empowering modx can be.

                      Another often mentionned aspect is Themes. One click CMS are meant to make it easy for people with little or no skills to set up a design by installing a theme. But themes have a rigid structure and the templates they contain are often fragmented. You don’t get any global view of what you’re doing. For me it’s a big disadvantage as a professionnal : I have never met a client in need of a "standard" look, what they want is to express their identity and singularity through their websites.

                      modx templates are built in such a way that you feel like working with static HTML while enjoying the power of dynamic content. No rigid structure, no php in templates but an easy, coherent and powerful syntax. The power of this approach is even more obvious when you need to control how the output of addons look, since modx addons can use chunks (reusable bit of content) as templates for their output.

                      I often say modx is template centric, while many CMS are feature centric, it might not be 100% accurate but it’s a least partially true.

                      Now you can’t deny modx has improved a lot, first with the install wizard module and revolution feature the web transport facility... but modx will never be a one click CMS and that’s good, because it’s more of a CMF anyway.

                      Last but not least, the question you asked to begin with : why is modx not number one ? Well, what is number one is my question ? User base is certainly an indicator that a CMS is successful, but successful does not always mean best... And best is relative to you needs as in "best fit". From day one, the aim what to provide unparalled flexibility to enthusiast and professionnal to whom it matters the most. In this area, I consider modx to already be number one...

                      I think revolution will open many doors and I hope to see some currently missing features happen, namely a comprehensive workflow module, a notification system, a file repository and a bunch of key addons to build community websites and or intranets extranets.


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


                        MODx est l&#39;outil id