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

    I am just wondering if there is any way to use tinyMCE as an input type for a TV ?

    i am trying to figure out a way to give my client a way to input lists and links in a client understandable way

    moi moi
    maja
      • 16183
      • 1,390 Posts
      Welcome to the forums maja!

      Using the input type "RichText" will do the trick...  smiley

      (If needed, set the widget to "RichText" [this is the output - only use if you want on front end of your site, I think]. Choose TinyMCE as your editor in the widget box if it’s not already chosen. Define the dimensions of the box in pixels as needed)

      That should do it..(don’t forget to choose the templates that the TVs will be accessible in)

      Have a look at this: http://www.modxcms.com/creating-a-template-variable.html

      /k

      * edited to correct use of "RTE in widget"
        • 18017
        • 4 Posts
        and change the main input to tinyMCE rolleyes

        thanks loads !
          • 18017
          • 4 Posts
          is there any way one can control the size of this input ? a smaller input means they won’t put to much text and brake the designing
            • 16183
            • 1,390 Posts
            Quote from: maja at Sep 04, 2008, 10:00 AM

            is there any way one can control the size of this input ?

            I’m not sure I follow...Do you have a local install of modx to test this? Put some dimensions in the tv widget’s width and height parameters, say width = 380px and height = 450px

            a smaller input means they won’t put to much text and brake the designing
            Not really. This is not a case of WYSIWYG; it is what you code is what you get wink If by designing you mean your website, that is all controlled by your template and css. Hope I haven’t misunderstood you.... smiley

            /k
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I’ve run across this before. The usual way to limit input to a text field is to have the limits set in the field itself using the maxlength attribute. That means hacking the TV code. The code is on line 25 of the file manager/includes/tmplvars.inc.php:
              $field_html .=  '<input type="text" id="tv'.$field_name.'" name="tv'.$field_name.'" value="'.htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" />';
              

              http://htmlhelp.com/reference/html40/forms/input.html

              That doesn’t help with texareas (line 34 of the same file), however.

              Here’s a good discussion on the topic (there is a typo where he says input type="file" where he means type="text")
              http://www.cs.tut.fi/~jkorpela/forms/textarea.html

              Another interesting bit of javascript to actually stop the user from entering more than the desired number of characters (although this can be bypassed if javascript is turned off, but then the Manager wouldn’t work at all):
              http://www.mediacollege.com/internet/javascript/form/limit-characters.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
                • 16183
                • 1,390 Posts
                uh, it seems I misunderstood you; sorry about that. Thanks for the help Susan smiley