We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26002
    • 30 Posts
    Hello everyone,

    I got to know about modx a couple of years now but whenever I want to make a website that has some custom features/functinality, I get stuck and have to leave and go try something else. I am good with design but not good with programing.

    But I always keep coming back here and know in the back of my mind that am missing something.

    The one thing I have heard is TV(Template variables).

    The issue is that I dont know how this works.

    Please can someone show me how I can for instance, create a form with calendar dates and a othe types of content with TVs?

    Is it even what its for?

    Please I need help. When I get my designs into modx, I am usually amazed at how easy it is to apply css and make the design exactly what I want.
    But by the time I need to add some unique functinality, I would be stuck since modx does not have the vast array of modules and comps like maybe joomla.

    Also talking about snippets, Is it possible to get a third party php script, copy the code and place in the snippet form and have it work in modx?

    If its possible, then I guess all the problems would be half solved.

    Any tips and help would be greatly appreciated.
      • 25663 MODX Staff
      • 12,272 Posts
      With MODx, the answer is invariably, "Yes, it’s possible..."

      From the snippets perspective, you’d be well-served having the PHP code return the data as opposed to echoing it. Other than that, there’s lots of 3rd party code that’s been used with MODx.

      TVs: think of them as custom content fields. Download and install the demo content and play with it, especially the @INHERIT binding associated with them.

      For forms, look at eForm. For calendars, I’d suggest starting with Easy Events to see if it fits your requirements.

      Good luck!
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 18367
        • 834 Posts
        Salvage,

        I know what you mean, MODx seems to be like a box of fantastic chocolates inside a sealed glass box. You know you’d be in heaven if only you could just get inside.

        All the tutorials and instructions seem to be written by people who are already inside the box, great for them, not so good for the rest of us.

        When Ryan says "return the data as opposed to echoing it" I have no idea what he even means.

        There are few good tutes around, but you really have to hunt for them.

        Most of the others just assume we know far too much, many of us aren’t programmers after all.

          Content Creator and Copywriter
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Don’t do
          echo "This is the output";
          

          Do
          $value = "This is the output";
          return $value;
          

          Snippets are more like functions, and you should gather all your output into a variable and return it at the end.
            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
            • 26002
            • 30 Posts
            Thanks all for responding.

            @rthrash, You said:
            ---------------------------------------------------------------------------------------------------------------------------
            TVs: think of them as custom content fields. Download and install the demo content and play with it, especially the @INHERIT binding associated with them.

            For forms, look at eForm. For calendars, I’d suggest starting with Easy Events to see if it fits your requirements.

            Good luck!
            ----------------------------------------------------------------------------------------------------------------------------
            grin , now this is what I and people like markg are talking about. Modx is very powerful and we know it deep in our guts and we need to get into it to fully use it but it seems daunting.

            When you say, TVs: think of them as custom fields. Download and dwnload and play with it especially the @INHERIT...., I feel like screeming out grin .
            And this is exactly the way its written in other bits of info that I have seen on it but that cant even begin to help me. What is @INHERIT and how does it work? Yes, modx is for people who know what they are doing with php but what of those of us that are into designing but dont need the restrictions of joomla?

            On the eform, the kind of form I was thinking of creating is a form that has more than just the basic name, address, comment fields. I would like a form that has select boxes and also a date fild that has a calendar for the selection of date(for a user to choose the date at which stuff will be needed like in booking/registration of stuff).

            I think the Easy Events calendar could be for showcasing upcoming events and stuff. Thats not exactly what I need. Thanks
            If eform can allow such custom fields above, I would definitely use it as a stop-gap for what I want to do.

            @sottwell,
            thanks for the code.
            I had no idea what rthrash was talking about in returning code and not echoing.
            Its going to take a while to learn PHP but for the meantime, the sites have got to go on, i suppose?
            Thanks for the help.
              • 26002
              • 30 Posts
              Quote from: markg at May 17, 2008, 04:11 AM

              Salvage,

              I know what you mean, MODx seems to be like a box of fantastic chocolates inside a sealed glass box. You know you’d be in heaven if only you could just get inside.

              All the tutorials and instructions seem to be written by people who are already inside the box, great for them, not so good for the rest of us.

              When Ryan says "return the data as opposed to echoing it" I have no idea what he even means.

              There are few good tutes around, but you really have to hunt for them.

              Most of the others just assume we know far too much, many of us aren’t programmers after all.


              @markg, I fully understand what u mean. Lets keep hoping that the very helpful gurus on this forum will consider our level when writing tips and tutorials grin

              They are very helpful here though. There are places you ask a question and two months later, no one has bothered. Try the Drupal forums and see(sorry, i couldnt help but say it.)
                • 26002
                • 30 Posts
                I forgot to ask.

                Please rthrash, you said there are some third party scripts that are already being used as snippets on modx.

                Please could you point me to implementations of these scripts?

                The idea for me is to get them and sturdy how the scripts have been turned to modx snippets.

                To know the codes that have been changed and the modx codes to be added in the scripts.
                  • 26002
                  • 30 Posts
                  Thanks ganeshXL

                  I will look at that piex and go through and report further findings.

                  Thanks