3

On Joomla 3.2.3, I added some custom fields to core components using a plugin (like this). It's working fine but I'd like to add the editor-xtd buttons to the customs editors added.

So my question is : how can I load the editor-xtd plugin into my custom fields plugin?

Thanks.

1
  • 1
    You should definitely upgrade to 3.3.6 before working with the code. I'm not a developer so I can't speak to your specific need, but I know changes are ongoing and I wouldn't test without being on the latest version. There would be significant changes between 3.2 and 3.3, not sure if any specifically relate to the editor plugin area without looking at the changelogs.
    – Toni Marie
    Commented Nov 14, 2014 at 19:57

1 Answer 1

1

If, I got right what you are asking, then the answer is that you need to create an Editor type form field, and set buttons="true".

Editor Form Field Type

Required:

type - this should be editor.
name - Use a unique name to define the field.
label - The label of the field - you can use translations.


Optional

width - Editor's width in pixels.
height - The height in pixels.
cols - Width in columns.
rows - Height in rows.
buttons - an array of xtd-buttons to be excluded or set to true/false.
hide - an array of xtd-buttons to hide. Set buttons="true", then hide="readmore,pagebreak,image"
editor - specifies which editor to use. (e.g. editor="jce")
filter - select the filter type e.g safehtml
description - The description that will show-up in the tooltip- when hovering over the label of the field - you can use translations.

XML Definition Example:

<field 
   name="myeditorfield" 
   label ="COM_CONTENT_MY_EDITOR_FIELD_LABEL"
   type="editor"
   editor="none"
   buttons="true"
   width="250"
   height="80"
   hide="image"
   filter="safehtml"
   description="COM_CONTENT_MY_EDITOR_FIELD_DESC" />

Notes

1. Default XTD-Editors plugins

Joomla comes with the following editors-xtd plugins: article, image, pagebreak and readmore.

2. About Translations

To use your own translations over the core components, you can create a per language override file and write there your language translations. You can use the backend language manager, or create them manually in the following locations:

Admin for english:

root/administrator/language/overrides/en-GB.override.ini

Site for english:

root/language/overrides/en-GB.override.ini

In the override.ini:

COM_CONTENT_MY_EDITOR_FIELD_LABEL = "Your field's label text"  
COM_CONTENT_MY_EDITOR_FIELD_DESC  = "The tooltip description text"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.