Try our conversational search powered by Generative AI!

Access content from content provider thru TinyMce "input / edit image" menu

Vote:
 

I am working on a content provider, drag and drop content from the asset panel to the TinyMce text-editor works. When opening the "input/ edit menu" and browsing for image url, the content provider does not appear. Is this something that has to do with configuration in the ui or do i have to extend the TinyMce? /Johan

#187215
Edited, Jan 16, 2018 9:28
Vote:
 

Got this from Epi-Support:

create a module.config

<?xml version="1.0" encoding="utf-8"?>
<module>

  <clientModule initializer="forceUseCustomMedia/Initializer">
    <moduleDependencies>
      <add dependency="CMS" type="RunAfter" />
    </moduleDependencies>
  </clientModule>

    <dojo>
        <paths>
            <add name="forceUseCustomMedia" path="scripts" />
        </paths>
    </dojo>
</module>

Create a module that concatenates the roots of the media and the content-provider contentrepositorydescriptors

define([
    "dojo",
    "dojo/_base/declare",

    "epi/_Module"
], function (
    dojo,
    declare,

    _Module
) {
    return declare([_Module], {
        initialize: function () {
			this.inherited(arguments);

			require([
				"epi/dependency"
			], function (
				dependency,
            ) {
       
					contentRepositoryDescriptors = dependency.resolve("epi.cms.contentRepositoryDescriptors");
					
                    var mediaRepositoryDescriptors = contentRepositoryDescriptors["media"];
                    var customMediaRepositoryDescriptors = contentRepositoryDescriptors["mycontentprovider"];
                    mediaRepositoryDescriptors.roots = mediaRepositoryDescriptors.roots.concat(customMediaRepositoryDescriptors.roots);

			});
        }
    });
});
#187950
Feb 07, 2018 9:26
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.