Keyword

Adding editor to TextArea field on plugin?

  • Francisco Caivano
  • Francisco Caivano's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #102088 by Francisco Caivano
Adding editor to TextArea field on plugin? was created by Francisco Caivano
Hi,

let's say for example this field:

<param name="google" type="text" size="40" default="" label="PLG_K2_UEF_GOOGLE_PLUS" description=""/>

From the User Extended Fields for K2.

If i wanted a Text Area, i can change it to:
<param name="google" type="textarea" size="40" default="" label="PLG_K2_UEF_GOOGLE_PLUS" description=""/>

But what about using the editor on it? Maybe the small editor K2 used to integrate, or default Joomla one...

?

Is that possible?

Like adding " editor="1" " as a parameter?

Thanks!

Please Log in or Create an account to join the conversation.

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
11 years 8 months ago #102089 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Adding editor to TextArea field on plugin?
Hi Francisco Caivano,

try -

<param name="google" type="editor" size="40" default="" label="PLG_K2_UEF_GOOGLE_PLUS" description=""/>

K2 Rocks \m/

Please Log in or Create an account to join the conversation.

  • Francisco Caivano
  • Francisco Caivano's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #102090 by Francisco Caivano
Replied by Francisco Caivano on topic Re: Adding editor to TextArea field on plugin?
I get:

"Element not defined for type"

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #102091 by Lefteris
Replied by Lefteris on topic Re: Adding editor to TextArea field on plugin?
Hi. The "editor" element is available only under Joomla! 2.5 . Since you are on another Joomla! version you need to write the element from scratch by yourself.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Francisco Caivano
  • Francisco Caivano's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #102092 by Francisco Caivano
Replied by Francisco Caivano on topic Re: Adding editor to TextArea field on plugin?
Im actually using Joomla 2.5.6 and K2 v2.5.7

..

So? any ideas?

Please Log in or Create an account to join the conversation.

  • Francisco Caivano
  • Francisco Caivano's Avatar Topic Author
  • Offline
  • New Member
More
11 years 7 months ago #102093 by Francisco Caivano
Replied by Francisco Caivano on topic Re: Adding editor to TextArea field on plugin?
Any new ideas?

type="editor" doesn't work

And i don't know where should i write/add this element to be able to get it on my plugin.

Thanks

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #102094 by Lefteris
Replied by Lefteris on topic Re: Adding editor to TextArea field on plugin?
@Francisco Caivano

You need to develop this element by yourself. K2 plugins still use the JElements instead of JFormFields to maintain compatibility with Joomla! 1.5.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Francisco Caivano
  • Francisco Caivano's Avatar Topic Author
  • Offline
  • New Member
More
11 years 7 months ago #102095 by Francisco Caivano
Replied by Francisco Caivano on topic Re: Adding editor to TextArea field on plugin?
Let's say i change all "JElements" class to "JFormFields", that should somehow work?


Shouldn't it detect im using Joomla 2.5, and use JFormFields instead of JElements automatically?


- - - -

Checking:
docs.joomla.org/Creating_a_custom_form_field_type

I can use this:
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('editor');

To load the "editor" form type, right?

But i don't know where....


- -- -

Shouldn't K2 load by default this form fields from Joomla 2.5, instead of 1.5 if im in that version?

I see the:
if(K2_JVERSION=='16'){
jimport('joomla.form.formfield');
class JFormFieldItem extends JFormField {




Help on this is very appreciated.

Please Log in or Create an account to join the conversation.

More
11 years 7 months ago #102096 by Lefteris
Replied by Lefteris on topic Re: Adding editor to TextArea field on plugin?
No. K2 plugins will not load JForm fields.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Francisco Caivano
  • Francisco Caivano's Avatar Topic Author
  • Offline
  • New Member
More
11 years 7 months ago #102097 by Francisco Caivano
Replied by Francisco Caivano on topic Re: Adding editor to TextArea field on plugin?
There is no way to load jFormFields in K2 Plugins?

No way?...

I'm screwed...

I needed to add multiple editor fields, in a custom made plugin....

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum