We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27327
    • 4 Posts
    Hello,
    This is my first post here. I have a question regarding modx templates variables. Actually I am involved in the creation of websites that use edit areas (input and textarea elements) which have a special behaviour attached to these by using javascript. I would like to add two template variable types TextUrdu and TextareaUrdu to the list of available template variable types. These would be similar to Text and Textarea template variable type with only a small piece of javascript attached. I want to if this can be accomplished easily without hacking a lot of core files. Any help in this regards will be appreciated.

    Regards,

    Nabeel
      • 25663 MODX Staff
      • 12,272 Posts
      For now you’ll need to modify the /manager/includes/tmplvars.inc.php file
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 27327
        • 4 Posts
        Hi rthrash,
        Thanks you for your prompt reply. I will be giving it a try. I will get back to you if there are any issues. If successful, I will also share my results here.
        Regards,
          • 7231
          • 4,205 Posts
          Here is a recent post with instructions on how to add a ’media’ type TV. This will show you all the steps grin
          http://modxcms.com/forums/index.php/topic,37229.0.html
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don't know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 27327
            • 4 Posts
            Quote from: dev_cw at Jul 08, 2009, 08:36 AM

            Here is a recent post with instructions on how to add a ’media’ type TV. This will show you all the steps grin
            http://modxcms.com grin/forums/index.php/topic,37229.0.html

            Thanks dev_cw, I had suspected that it would involve more files than just the /manager/includes/tmplvars.inc.php file. I just appended the javascript to the Text and Textarea definitions in the /manager/includes/tmplvars.inc.php file and as a result it affected every instance of these TV types. But now I will also try the other approach that you have hinted at. If successful, I will also provide modification’s code here. Thanks for your great support.
              • 27327
              • 4 Posts
              Hello, I just wanted to say thanks. I was able to create a new template variable type and then use it in new documents. Actually I just had a look at the way Drupal’s Custom Content Creation (CCK) module works and it has a mechanism that allows you to create custom field types for it without hacking any core files. I wanted to ask if this functionality is something that is a part of the roadmap of Modx?
                • 25663 MODX Staff
                • 12,272 Posts
                Yes, though not for the immediate future in Evo 1.0 or Revo 2.0.
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me