We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13269
    • 15 Posts
    I am having a difficlut time getting the big Modx picture and am not sure if it’s what I’m looking for. It’s hard to determine the relationship between a TV, Chunck, Snippet, and Module. I can’t figure out, as a newbie, which one to use, and what the difference is besides the obvious. The online documentaion is of little help. I need to understand the big picture so I can evaluate the software. If  I have to spend a lot of time on evaluation I will just bypass it and move on to the next cms. Most of the functionality I will need won’t be available in snippets or plugins ect so I will have to develop it but I just can’t seem to find any thorough documentation, just bits and pieces. I like what I see so far, but don’t have the time to make it a career. I realize everyone wants to be a programmer but the application is no better than the documentation. And there’s no more important documentation than documentation that provides the all import fundamental basics and their realtionships. Can anyone provide any tips or pointers on how to get a basic fundatmental perspective on how to design a site using Modx. The install site doesn’t even use a TV so it’s pretty tough to figure out what it’s all about when the top piece is missing. I really think the concept is a good one but you’ll never compete with Mambo, Typo3, and the like if you get passed by because no one would spend a little time on a graphic or turorial or two. I not giving up yet, but I am getting weary. Of course I’d stop complaining and focus on the really great aspects of Modx if someone as capable as Sotw@#&& would volunteer to put their exceptional talents to work and come up with a real hooker of a tutorial... Today’s Motto: Help a newbie and you’ve go a friend for life...
      • 18397
      • 3,250 Posts
      The default install site will be improved upon greatly in the next release but in the meantime here is a new bit of documentation to help you out.

      See my new bit of documentation at

      http://modxcms.com/forums/index.php/topic,954
        • 1764
        • 680 Posts
        I understand your frustration. It took me a while to get a grasp on all of the different elements that make up a MODx site.

        First of all you have to remember that MODx is still nothnig more than a Technology Preview. We’re still a long ways off from a 1.0 release and a LOT is going to change before we get there. That is the biggest reason why you don’t see a lot of detailed documentaiton online. We will be changing the names of TVs, Chunks, Snippets, Modules, etc. to try to make them more intuitive. Also, the 3.3 release will include a new template, TVs, Snippets, Plugins and Modules all in the default install. Seeing how these works in a default install should be very helpful to you.

        Now I’ve said a lot but don’t worry I’m going to do my best to give you some practical advice.

        CONTENT

        Template Variables
        Template Variables are really nothing more than a content holder. The content area is really nothing more than a TV, it’s just hard wired into the system. The default install allows you to define nothing more than title, description and content. But what if you want to define content in a header, footer, sidebar, or even header content?

        Chunks
        Chunks are really fairly similar to TVs. The two things that separate them are that Chunks, unlike TVs, are plain text and while TVs define specific content for each page, Chunks are global to the whole site and can be referenced from any page.

        CODE

        Snippets
        Snippets are small PHP scripts that are called from within a page. Snippets are almost always used to output dynamic content.

        Plugins
        Plugins are scripts that respond to certain events. Plugins have a very wide variety of uses. They can be used for content and for extending the manager. Plugins are also probably the hardest thing to develop. At this point the documentaiton on each event just isn’t there. If you want to write a plugin you’ll probably have to poke around in the core.

        Modules
        Modules extend the manager and act as a link between snippets and plugins. Modules are only accessible to a person logged into the manager. A module can be almost anything. It’s really just a blank PHP file with easy access to the core API.

        Bottom line, to start out with I wouldn’t worry about Chunks, Plugins or Modules. TVs and Snippets are the real building blocks to a site. Chunks can be a handy shortcut but are rarely necesary. Plugins and modules are designed for advanced users and are not typically something that you need to worry about developing on a day-by-day basis.

        I hope that this helps you out. Don’t give up yet. Give it a few weeks and it’ll be second nature.

        P.S. Mark beat me to it but I’m going to post this anyway
        • Hi ixie01,

          Thanks for giving us a look, but we’re really in pre-release. We’re definitely not geared up to open a "MODx school" by any means. As Adam mentioned, we’re only releasing code as we make progress for those that want to see what’s going on.

          However, I can say from spending the better part of 2 years looking just like it sounds you’re looking, MODx is much more intuitive and easy to get up to speed on. It does take a bit of time getting your head around the conepts though, and I agree the terminology and base explanation of the system pretty much sucks right now. But we’re making big, BIG changes in that department, and you’ll be sad you left if you do wink ...

          Perhaps you could share what it is you’re wanting to do. And hopefully with short paragraphs. tongue
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 18397
            • 3,250 Posts
            Quote from: rthrash at Sep 16, 2005, 03:06 AM

            And hopefully with short paragraphs. tongue

            Very funny, laughs.
            • I use chunks to contain my site’s footer, and put it in the <div id=footer> tags of all templates I use; this way if I have different templates for different pages (maybe I need a wider content area for a big form or something) I’ll have the same footer across the whole site, and only need to change it once to change it everywhere. Think of it as a template-within-a-template.

              Snippets are very much like inline php tags; you can plug in a [[snippet]] tag the same way you would a <?php do something in code here ?> tag (as is the case with all php templating systems, such as Smarty). In some ways snippets and TVs are interchangable; I try to keep general code to snippets, and code or content that I want to be able to manipulate on a page-by-page basis to TVs. Often a TV will contain a choice of objects to choose from, as I do with chunks for sideblocks. They are also editable on a page-by-page basis if so designed. I know that I’ve barely scratched the surface on their capabilities.

              What I really like is the manner in which "documents" or pages are managed. You can have your chunks, snippets, TVs or plugins in the template, for site-wide application, or on a page-by-page application within the document content for each page. And the tree-like system makes creating a mulitlanguage site very easy.

              Its simplicity is the real beauty of the MODx system. There are a number of snippets and TVs available to do all kinds of things, they aren’t difficult to make, and as the community grows there are more all the time. It is by far the cleanest, most flexible system I’ve run across. I needed to modify the back-end for one client, and it was pretty easy then, even before the new module system. And it’s getting better almost by the week; these guys are really good.
                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
                • 13269
                • 15 Posts
                Thanks for the great info. It appears I can use @bindings to go from a TV to a chunk but How can I incorporate php code in this senerio? Is it a situation where you use either a TV, chunk combination or a snippet by itself or can all three be used together? It seems that I could do everything in a snippet. Also, my user will have to do a lot of file maintence, adding to directory listings, posting events, posting photos and the ussual stuff. Would this be the function of a module or this better handled on the front end in a snippet?
                • I have one TV that I use for multilanguage sites; I could probably use a snippet, but hey, this was my first try at TVs!

                  I named it "lang".
                  This gets put into the Default value field:
                  @EVAL
                  if($modx->documentObject['parent'] == 0) {
                  $lang=$modx->documentIdentifier;
                  }
                  else
                   if(isset($_COOKIE['Language'])) {$lang=$_COOKIE['Language'];}
                  else {$lang=$modx->config['site_start'];}
                  return $lang;

                  Then wherever you need the $lang value, just put [*lang*]. As I said before, this could probably be done just as well in a snippet. I’ve been wondering about the performance of a snippet vs. a TV in a case like this.

                  Full discussion of the multilanguage system, including the snippet, the chunk, and the TV, with a pdf tutorial for download:

                  http://modxcms.com/forums/index.php/topic,409.0.html

                  They can all be used together, along with a document’s content. A discussion of my other use of a TV for selecting blocks to display in the sidebar of a page goes into that idea.

                  http://modxcms.com/forums/index.php/topic,901.0.html

                    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
                    • 13269
                    • 15 Posts
                    Again, thanks for all the great info.

                    The problem I am having with the cms apps I’ve been evaluating is with my clients unwillingness to spend the time necessary to learn the system. The back end always seems to turn them off.

                    Most of clients are small business owners 40+ years of age, under staffed, and very illiterate when it come to computers. Most of them however need dynamic funtionality in their sites and I have been having to custom write scripts/forms that a 2 year old could use. What I’ve been searching for is a cms that I could include my scripts or third party in, with user management, and one where the client would never have to interact with the back end, but they would have to add pages.

                    What appealed to me most about modx was the easy templating. Lastly, since I wear so many hats, I’m looking for a system that is simple or intuitive enough that if I only dealt with it every 6 months or so I could still find my way around without out a great deal of relearning. The nature of my business doesn’t allow me to specialize in anything. For example I am a web designer, php/asp developer, accountant, IBM AS400 programmer(rpg) network administrator, janitor... well you get the picture. I believe that just using the snippet functionality might server my purpose and it seems simple enough. Of course I can still incorporate the functionality of modx developers.

                    So right now the things I’m looking for is a cms that doesn’t have to be a carreer, one where I can assign dynamic functionality to web users(who are really administrators) thus keeping them out of the back end, and giving them the ability to add pages. I have a feeling Modx can do all of this, I just have to get started in the right direction and as time goes by I will learn the intricacies . 

                    note: edited into paragraphs
                      • 18397
                      • 3,250 Posts
                      ixie01 I believe MODx can do all you ask (an more of course!)

                      Take a look at these items for frontend editing

                      NewsPublisher Snippet (newer version in these forums than the one in TP3.2)

                      QuickEdit plugin/module (full frontend editing by just using [*#style*] template variables.

                      At the moment (anything is possible with some modifications though) the only things these can’t do is delete pages or alter some backend settings such as publish date, etc.

                      But these features will be there in the future.....

                      Best of luck!

                      P.S. Paragraphs make it a lot easier to read so a quicker response is possible......