We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1778
    • 659 Posts
    Hi all
    Is there somewhere an up to date tutorial on how to create custom tvs ? The actual rtfm seems out of date for these kind of things...
    In example for the custom TV input types, rtfm mentions 'you need only 2 files' (one php, and one tpl) examples given are very light, but it does not talk at all about the modTemplateVarInputRender class and how to use it...
    Nothing on the need of a plugin (at least when you develop outside modx) , nothing on which system event to set and why and how... with simple explanations like, 'this event fires when ... it loads this file or do this thing'...

    And other things that would be helpful for all of us, i.e. how to deal with multiple values ?

    Diving in the existing codes of existing custom tvs is very frustrating : it consumes a loooooot of time, and often the tvs are not coded the same way even if they offer more or less the same 'service' that is source of more confusion and frustration....

    Cheers
    [ed. note: anso last edited this post 14 years, 5 months ago.]
      • 28215
      • 4,149 Posts
      I've written a small doc about it here:

      http://rtfm.modx.com/display/revolution20/Adding+a+Custom+TV+Type+-+MODX+2.2

      This will change a bit in MODX 2.3; Namespaces will take a bit more precedence and handle the path routing, and creating custom TVs should be a bit simpler then.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 1778
        • 659 Posts
        Hi Shaun
        Thanks a lot for this small doc it will be very helpful for all of us...
        I've just upgrade to 2.3.0-dev from git, I'm glad to see the pathing plugin is not required anymore...
        Thanks again for all your excellent work on MODx
        Cheers
          • 10378
          • 375 Posts
          Shaun,

          could this be a small error in your custom TV doc?
          http://rtfm.modx.com/display/revolution20/Adding+a+Custom+TV+Type+-+MODX+2.2

          We'll need a plugin to tell MODX where our custom TV directories are. Go ahead and make a plugin called "OurTvsPlugin", and assign it to the following events:
          
          OnTVInputRenderList - For rendering the actual TV input in the backend
          OnTVOutputRenderList - For rendering the TV output in the frontend
          OnTVInputPropertiesList - For loading any custom properties for the input render in the manager
          OnTVOutputRenderPropertiesList - For loading any custom properties for the output render (front-end) of the TV
          [b]OnDocFormPrerender[/b] - For loading any custom JS/CSS for our TV
          Now put in the Plugin code:
          



          ...
              case 'OnManagerPageBeforeRender':
                  break;
          ...
          


          In the description you wrote we have to attach to the event OnDocFormPrerender but in the plugin code there is another event specidfied OnManagerPageBeforeRender

          Is this correct?
          I just working through some tutorials and such things are a little confusing...
            Freelancer @bitego http://www.bitego.com
            ---
            GoodNews - one of the most advanced and integrated Group Mailer premium add-ons for MODX Revolution!
            More infos here: http://www.bitego.com/extras/goodnews/