We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3647
    • 177 Posts
    Hi

    I am trying to use webloginPE to create a listing directory and have added several custom fields for the detail of the listings.

    However, the question I have at the moment is, how could I make a field, e.g. description, a rich text field or somehow allow some formatting in the field like paragraphs etc.
    This would need to be done on the update profile form. At the moment any entry just gets shown as 1 long line of text.

    Any ideas or pointers?

    Regards

    Mark
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It is possible to use TinyMCE in a snippet. You just need to have the textarea, and have the javascript that loads Tiny into the form in its place.
        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
        • 3647
        • 177 Posts
        That is brilliant!!

        For the benefit of others I simply had to add the following code to my profileTpl template

        <script type="text/javascript" src="assets/plugins/tinymce3101/jscripts/tiny_mce/tiny_mce.js"></script>
        <script type="text/javascript">
        tinyMCE.init({
        mode : "textareas",
        theme : "simple"
        });
        </script>

        and make sure the fields you want to use the editor in are set as ’textarea’
        This gives me a cut down editor with just the basic text tools, no image insert etc

        Thanks again Sottwell!
          • 22897 ☆ A M B ☆
          • 209 Posts
          Do watch out for the security implications of doing this, as unless you have some HTML filtering going on behind the scenes (e.g. HTMLPurifier linked in) then your users can inject *any* HTML into your website - including malicious Javascript.
            MAPLEDESIGN MODX development and MODX web design and custom development. Proud to serve UK and International clients!