• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
 Post subject: TinyMCE template plugin
PostPosted: Tue May 15, 2007 4:07 pm 
Looking at the Moxiecode website I see that they say that the installation of TinyMCE comes bundled with a template plugin (see here: http://wiki.moxiecode.com/index.php/Tin ... s/template).

This allows the end-user who is editing the page content to select snippets of predefined page content.

This button/option is not available in the list of plugins available with the TinyMCE I have installed in my CMSMS. I realise that it would also require a source of snippets for the user to browse and select from, but is it possible to incorporate this functionality into the TinyMCE implementation in CMSMS?

An example of how this is implemented can be seen here (it is the third button from the right on the bottom toolbar Image):

http://tinymce.moxiecode.com/example_fu ... ample=true

The content editors/users of our new website which I have planning to build in CMSMS would want to sometimes add custom pre-defined content and this method of managing this for them would be ideal.

Please - can it be done and if so how?

Thanks in advance.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Tue May 15, 2007 6:24 pm 
Anastasis wrote:
but is it possible to incorporate this functionality into the TinyMCE implementation in CMSMS?


Its easy - you have to replace TinyMCE version that comes with CMSms module with current TinyMCE version 2.1.1.1. This one contains template plugin ;).


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Tue May 15, 2007 10:11 pm 
Cyberman - thanks for your answer on this.

I assume that the management of these predefined content templates is integral within TinyMCE - wrongly I had it in my head that this would be to do with CMSMS.

Anyway, as TinyMCE v2.1.1.1 is not available as a module in my version of CMSMS (v1.04), I decided to download the v2.1.1.1 zip file from the TinyMCE website and unzipped it. The folder in the zip is called "tinymce" (all lowercase) and this ties up with the folder of the same name in CMSMS which is located under a folder called "TinyMCE" that also contains some php files and a couple of other folders.

I renamed the old "tinymce" sub-folder and uploaded the new "tinymce" folder to the same location thinking that is all that I needed to do, but now there is no editor showing when editing a page. I have obviously misunderstood something but I don't know what.

Any help on sorting out my TinyMCE configuration to the latest version would be much appreciated.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Wed May 16, 2007 8:41 am 
OK, I have now got it working again.  :)

A search of posts for "tinymce" in the forums threw up a post which suggested that the "Use TinyMCE compression module" option may be an issue. I don't know whether or not it was checked in the v2.0.4 version that I used previously, but unchecking it with v2.1.1.1 made TinyMCE work again. :)

Looking again, the post was by you Cyberman (see http://forum.cmsmadesimple.org/index.ph ... l#msg51112), so thanks for that. :)

All I need now is to work out how TinyMCE allows you to define new snippets of predefined page content as at the moment the combo in the TinyMCE template dialog is not populated (not surprisingly as I haven't defined any) but there is no interface by which to create new ones.


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Wed May 16, 2007 10:05 am 
Anastasis wrote:
but there is no interface by which to create new ones.


Right - there's no one. TinyMCE Templates are "simple" html files. You have only to add path to that files inside modules php like that

Quote:
template_templates : [
{
title : "Editor Details",
src : "editor_details.htm",
description : "Adds Editor Name and Staff ID"
},
{
title : "Timestamp",
src : "time.htm",
description : "Adds an editing timestamp."
}


Please search in source for tinyMCE.init. Your posted moxiecode wiki link helps you to do the right :).


Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Wed May 16, 2007 2:26 pm 
Thanks Cyberman for this.

I had a look on the Moxiecode website re the template configuration. I think I prefer the option to make the list of templates external to the "tinyconfig.php" file by using the "template_external_list_url" parameter. That would then mean editing a smaller simpler file than modifying the large config file every time.

However, although I know this external list file could go anywhere, I am unsure as to the best place to locate this file in the CMSMS site structure. Also, where then to put the actual template files and thereby define the correct relative paths to make the structure flexible.

Currently, I am testing the site in a sub-folder of my site folder, but the site when live will be moved to the root folder of another site URL. Also, there is then the issue that many of the templates will contain links to images (located in uploads/images) so the relatives paths to those also need to be defined correctly so as to be viewable by the editor user.

It would be easier to give everything an absolute path but it feels like that goes against the right way to define them by using relative paths. My head though is a bit frazzled by all of this.

Is anyone using TinyMCE templates in CMSMS? If so, how have you set yours up to be flexible?


Last edited by Anastasis on Wed May 16, 2007 2:28 pm, edited 1 time in total.

Top
   
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Wed May 16, 2007 9:53 pm 
Offline
Power Poster
Power Poster

Joined: Tue Dec 13, 2005 10:50 pm
Posts: 1409
Location: Finland
just a suggestion (and I'm not sure if this works at all) but use template externalizer to export your templates to files. then point tiny to one of those templates.

this way you can edit the template in cmsms admin ;)


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Wed Mar 18, 2009 1:01 pm 
Offline
New Member
New Member

Joined: Wed Mar 18, 2009 2:45 am
Posts: 2
Hello
Where do we have to put the code

template_templates : [
      {
        title : "Editor Details",
        src : "editor_details.htm",
        description : "Adds Editor Name and Staff ID"
      },
      {
        title : "Timestamp",
        src : "time.htm",
        description : "Adds an editing timestamp."
      }

Thanks


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Wed May 19, 2010 6:48 pm 
Offline
Forum Members
Forum Members

Joined: Sun Apr 15, 2007 6:53 pm
Posts: 33
Looks like kindof a dead thread, but I just went through the process of figuring out how this works, so I'll share my findings for anyone who wants to use the template plugin in TinyMCE.

The trick is to place the configuration code in the "Extra configuration" box in the advanced tab in the TinyMCE config page.

I put this in as a test:
Code:
template_templates : [
      {
         title : "simple snippet",
         src : "tinytemplates/snippet.html",
         description : "add a test snippet"
      }
      ],
template_replace_values : {
   test : "TEST CONTENT"
}


And snippet.html:
Code:
<p class="test">This is a simple <strong>snippet</strong>. Will be replaced: {$test}.</p>


The path to the template is relative to the web root. There is a suggestion above that you could use Template Externalizer to manage the template, and that would work, but these templates become static once inserted into the content--i.e. you won't be able to change all instances of the template by editing the source template.

This plugin is really just a way to insert complex snippets and give you some variables that will be applied at the time it's inserted. You could, (and I haven't figured this out yet) have a pop-up come in that asked for specific content, then when the snippet was inserted, that content would be placed in the snippet. For instance, if you wanted to add a caption to an image, this plugin would allow you to select the image, type in the caption, and then it would do the job of wrapping the caption and image together.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Fri May 21, 2010 8:55 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 12640
Location: Arizona
This whole tiny template thing has been discussed and resolved in another post, a simple search and most likely this post would have never happened...

_________________
Check ver. CMSMS, PHP, server OS, in System Information page.
Default content http://multiintech.com/defaultcontent/
People are Wonderful
Business is Great
Life is Terrific
Ever wonder what happened to the Album module? Well it is alive and well.
http://album.multiintech.com/
Image


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: TinyMCE template plugin
PostPosted: Tue Nov 16, 2010 11:04 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Jul 29, 2010 11:09 pm
Posts: 149
Location: Portland, OR
I did a straightforward how to. Check it out at

http://forum.cmsmadesimple.org/index.php/topic,49098.0.html


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Hosting Nation - Managed CMSMS Hosting