TinyMCE - Predefined Template Content

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Looks like a potentially nice feature in the topic editor.  Any documentation out there on how to setup templates?
11 years ago
Hi,
no answer to your question but I also like to know.

In search of a simple possibility to load my plugin into a page when a category is selected I stumbled across this too.
Its one of those nice icons you can select to configure the category description called "Insert Predefined Template Content".

Does anybody know how where to add what, so that this list shows your template?
11 years ago
I did a little digging.  Take a look at this file:

Presentation\Nop.Web\Administration\Views\Shared\EditorTemplates\RichEditor.cshtml

Inside the file you will see:
            
// Drop lists for link/image/media/template dialogs
template_external_list_url: "lists/template_list.js",
external_link_list_url: "lists/link_list.js",
external_image_list_url: "lists/image_list.js",
media_external_list_url: "lists/media_list.js"

I think template_list.js needs to be edited.
11 years ago
Hi, Has anyone got this to work yet? I've been working on it and here's what I've done so far:

*Created an html file that contains a newsletter template named Classes.html

*Created js file of list (my list contains only one (class.html) file). The file named template_list.js is like this:

var tinyMCETemplateList = new Array(
        // Name, URL
        ["Classes", "Classes.html"],
        
);

I have a drop down named Classes when I click the predefined template button but the template itself doesn't come in. The Tinymce site has a simple html example that doesn't contain anything else but a simple string. I copied that htm file over to my sample and I again, have a drop down box but no template preview. I know the path is correct---and I'm not receiving any errors at all in Firebug.

Is there anything special I would need to add to the html page due to changes to Tinymce by NOP?

If anyone could point me in a direction for an answer. I've go a bunch of time into this issue. Thank you.
11 years ago
Still working on this issue. I noticed that RichEditor.cshtml contains the following comment: "//we do not bundle this script file (does not work for some reasons in bundle)"

According to the tinymce site it's pretty important that the original file structure of the tinymce be kept together for all the components to work.

Is it possible that pulling the script out of the tinymce structure causes the template function not to work? I can get the template drop down box to populate but the plugin will not parse the html in for use. Is there another way to get this script to work with NOP while still keeping the script within the tinymce module?

Can this issue be added to the current update so everyone can add their own customized content? Would be really nice!
11 years ago
marie77777 wrote:
Still working on this issue.
Thanks Marie for working on this.  Unfortunately I've not had the time to look at it.

I'm starting to thing that my time might be better spent evaluating alternatives to TinyMCE, starting with this list on github.

I'm not that thrilled with certain aspects, including image upload (images thumbnails are distorted and uploading is clunky and confusing at best), and of course Templates.  I know there must be some great editors out there.

I also think that nopCommerce should have an inline editing capability, for topics at a minimum.
11 years ago
So at this point I'm planning to dump TinyMCE, and am taking a serious look at CKEditor.  I love the user experience and according to 1st webdesigner CKeditor "is the new FCKEditor that ... aims to fix what FCKEditor got wrong."

It supports templates!

Its CKFinder image browse/upload is stunning (but does require buying a license.)  Fine with me, I have no issue paying a reasonable fee for solid software.

Anyway I'm going to do some integration testing and report back.

NOTE: If anyone else has already integrated CKeditor (and its companion CKFinder) please let me know.  I think CKFinder is way too nice to leave out of the deal.
11 years ago
I've figured out the problem. Tinymce is looking for folder Admin/Campaign in the root directory. If I put my template file in that folder the template is available via the drop down menu. But with that folder in the Root directory the administrative area is not found on the next login.

Since I didn't add the path Admin/Campaign into Nop or Tinymce and a search of the files on my site doesn't find that path I don't know where to go and change it. My guess is that it is hard coded into NOP Commerce somewhere (Tinymce doesn't have names like Campaign so I've ruled that out).

Please, someone help me find where to change this. The templates aren't only for the Campaign areas. They can make administrative duties in all areas that the Rich editor appears easier and more efficient.
11 years ago
Working here white 2.80 :)

Use Absolute URL's:

I made a folder in /Content called templates
in that i put a folder /lists

/content/templates:
your .html template's

/content/templates/lists:
template_list.js (or whatever you call it)

Containing:

var tinyMCETemplateList = [
        // Name, URL, Description
        ["Newsletter Monthly", "http://www.your-domain.net/content/templates/news_monthly.html", "Monthly Newsletter."],
        ["Newsletter Special Offer", "http://www.your-domain.net/content/templates/news_special.html", "Special Offers."]
];


Now edit /Administration/Views/Shared/EditorTemplates/RichEditor.cshtml (line 41 if org.):


template_external_list_url: "http://www.your-domain.net/content/templates/lists/template_list.js",


Try it, it works for me
11 years ago
What browser are you using to view the template in admin? After upgrading my site to NOP 2.8 I got the templates to work using the absolute URL's but the templates only appear in Firefox. Using IE 9 and Chrome the menu item shows in the drop down box but the template doesn't appear. (just a blank screen) I'd love to get this issue resolved but most of my sites use some version of IE.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.