cancel
Showing results for 
Search instead for 
Did you mean: 

select repository content using tinymce

boneill
Star Contributor
Star Contributor
Hi All,

It appears that it is not possible to use the wysiwig editor (tinymce) to select an image or video to include within the text that a user creates with tinymce.  The image and link buttons are available in tinymce but they do not give you an option to link to any repository content.  Our use case is quite straight foreward, users want to be able to embed images and/or videos into the text they are creating at random points.  These images are stored in the repository.

Is there any way to change tinymce to give it access to items in the repository.

regards
4 REPLIES 4

iann
Champ in-the-making
Champ in-the-making
Hi Brian,

I've put together a simple extension for the tinyMCE editor that might be some help, I've only tested it in Share, but it's intended for quickstart, I'll upload the AMPs and a quick blog page on how it works.

Regards,

Ian

boneill
Star Contributor
Star Contributor
Hi Ian,

That is fantastic.  Looking forward to getting your amp and blog.  Thankyou very much for the help.

iann
Champ in-the-making
Champ in-the-making
Hi Brian,

I don't think I can upload files here so I've uploaded them to a page, it goes through the install process - I've just tested it on a fresh 3.4.d install and it worked fine.

The install consists of two amps, one for the repository and one for share, there's a few things that I need to work on and they're listed at the bottom of the page - essentially it's a working 'work in progress'

http://www.cognition-web.co.uk/news/4-blog/21-alfresco-share-wysiwyg-file-browser

You'll need to make some changes to the to the share-config-custom file, firstly adding the dependencies for the javascripts (i've also included some to paste from word in mine)

   <config>
         <forms>
             <dependencies>
              <js src="/treeview/assets/js/convertword.js" />
              <js src="/treeview/assets/js/sharefilebrowser.js" />
             </dependencies>
          </forms>
   </config>

and then amend the cm:content control:

<appearance>
             <field id="cm:content">
                  <control template="/org/alfresco/components/form/controls/content.ftl">
                     <control-param name="forceEditor">true</control-param>
                     <control-param name="editorHeight">400</control-param>
                     <control-param name="editorWidth">700</control-param>
                     <control-param name="richMimeTypes">text/html,text/xhtml,text/plain</control-param>
                     <control-param name="editorAppearance">custom</control-param>
                     <control-param name="editorParameters">
                        plugins: "fullscreen,paste",
                        file_browser_callback :
                        'shareFileBrowser',
                        paste_create_paragraphs : false,
                        paste_create_linebreaks : false,
                        paste_use_dialog : true,
                        paste_auto_cleanup_on_paste : true,
                        paste_convert_middot_lists : false,
                        paste_unindented_list_class : "unindentedList",
                        paste_convert_headers_to_strong : true,
                        paste_insert_word_content_callback : "convertWord",
                        theme_advanced_buttons1: "bold,italic,separator,formatselect,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,link,unlink,separator,image,separator,undo,redo,separator,cut,copy,paste,pastetext,pasteword,image,help,code,fullscreen",
                        theme_advanced_buttons2: "",
                        theme_advanced_buttons3: "",
                        theme_advanced_resizing: true
                     </control-param>
                  </control>
               </field>
             </appearance>

Again I've included this as a download, but you'll most likely want to merge it into your own code.

iann
Champ in-the-making
Champ in-the-making
Actually, having had a look at this today - the only thing stopping it from working in the AWE ribbon interface is that I've not found a way to add javascript includes into the form config XML (awe-config-custom.xml) The JS includes are stripped out unfortunately…

Does anyone have any sugegstions to get around this?