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.]
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
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...