1

Topic: Configuring paths with the template plugin

I am new to TinyMCE, but finding it to be a very powerful tool.

I am building my first CMS-based website (using an open source CMS tool) with TinyMCE as the editor.

At the moment, I am trying to implement the TinyMCE template plugin for use by the editor users for inserting predefined content such as sidebar adverts using image banners. However, I am getting very confused by how to define the relative paths. I could use absolute paths but then that could make the setup inflexible if moving the site to a different site URL which is likely.

I would like to use the "template_external_list_url" option to separate out the list of templates from the php file containing the tinyMCE.init as the php file containing tinyMCE.init is quite large.

I have looked at the TinyMCE wiki but am no clearer.

Please could someone make clear to me what to do assuming the following structure:

mysite.co.uk/cms/modules/tinymce contains the php file containing tinyMCE.init with the template_external_list_url parameter

If storing both the template-list.js and the html templates in:

mysite.co.uk/cms/uploads/tinymce_templates

and having images that need to be linked to in the html templates stored in:

mysite.co.uk/cms/uploads/images

how should I configure the path to the:

1. template-list.js (template_external_list_url) ?

2. template html files in the template-list.js (e.g. snippet1.htm)?

3. The banner images linked to in the template html files (e.g. advert.jpg) ?


If there are better default locations for the template-list.js and the html template files then they can be located elsewhere, but the images folder cannot change.

Sorry, I think I am probably being a bit dim and missing something simple here, but any help on this would be appreciated.

Last edited by Anastasis (2007-05-16 17:57:50)

2

Re: Configuring paths with the template plugin

As a follow up to my earlier question (for which I still haven't found the answer), I came across the "document_base_url" option.

In the context of the above examples, this is now set to: mysite.co.uk/cms/ along with relative_urls : "true" but I still cannot get templates to populate the combo in the templates dialog using the following:

template_external_list_url : 'uploads/tinymce_templates/template_list.js' for the external list

and then the external list contains the following:

var tinyMCETemplateList = [
    // Name, URL, Description
    ["Simple snippet", "uploads/tinymce_templates/snippet1.htm", "Simple HTML snippet."],
    ["Layout", "uploads/tinymce_templates/layout1.htm", "HTML Layout."]
];

I am sure I must be missing something obvious here, but at the moment it is not obvious to me! <;o(

Any help on this would be much appreciated.

3

Re: Configuring paths with the template plugin

Any clues on this one anyone? smile

4

Re: Configuring paths with the template plugin

I have just posted some comments on the discussion page associated with http://wiki.moxiecode.com/index.php/Tin … s/template - this may or may not help you.

Scott

(a.k.a. monkeybrain)

5

Re: Configuring paths with the template plugin

My template plugin does not load choices in selectbox. I looked in template.htm and I found this code: 
<option value="">{$lang_template_select}...</option>
There is no other option tag... How would templates be loaded?

And something else... What is the difference between files in template_external_list_url and files in template_templates?

Thanks...

6

Re: Configuring paths with the template plugin

Anyone????