16 years 9 months ago #68745
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Extra WYSIWYG fields
Extra WYSIWYG fields
16 years 9 months ago #68746
The easiest thing to do is put the following under case 'textarea' in extrafield.php:
$editor =& JFactory::getEditor();
$output = $editor->display("K2ExtraField_".$extraField->id."", $active, '550', '400', '60', '20', false);
This will give you a text editor when you select a field of type text area.
It works in front end editing, V2.2.
$editor =& JFactory::getEditor();
$output = $editor->display("K2ExtraField_".$extraField->id."", $active, '550', '400', '60', '20', false);
This will give you a text editor when you select a field of type text area.
It works in front end editing, V2.2.
16 years 9 months ago #68747
Hi Lee
Did you ever find out if you could use joomla plugin tags in the extra fields?
All I get is the code displayed
lee said:If we get a text area with the editor working can the text entered into this area also be made to picked up by any joomla plugins? eg. I have a plugin that picks up any {audio},{/audio} tags and inserts an audio player in its place. I would like to be able to use these tags in one of the extra fields but the plugin seems to have no effect on extra fields - only in the article text itself?
Did you ever find out if you could use joomla plugin tags in the extra fields?
All I get is the code displayed
lee said:If we get a text area with the editor working can the text entered into this area also be made to picked up by any joomla plugins? eg. I have a plugin that picks up any {audio},{/audio} tags and inserts an audio player in its place. I would like to be able to use these tags in one of the extra fields but the plugin seems to have no effect on extra fields - only in the article text itself?
16 years 8 months ago #68748
Hallo,
would like to ask for the Feature "WYSIWYG" in the text field (Backend). What I understand in this discussion is:
This Feature is also not available in Version 2.2. Right ??
Is there any "trick" to get this (importend) feature in Version 2,2 ????
Is there a Timeline to include WYSIWYG ?
Thanks for any reply / help
Greetings Hans
would like to ask for the Feature "WYSIWYG" in the text field (Backend). What I understand in this discussion is:
This Feature is also not available in Version 2.2. Right ??
Is there any "trick" to get this (importend) feature in Version 2,2 ????
Is there a Timeline to include WYSIWYG ?
Thanks for any reply / help
Greetings Hans
16 years 8 months ago #68749
Looking at the current code repository for 2.3, it looks like an option has been included to use wysiwig editors on extra text fields if required..
Good news!!!
Good news!!!
16 years 7 months ago #68750
Running latest JCE and K2 v2.2... This fix does not work... shame. Will have to look at Zoo me thinks.....
16 years 7 months ago #68751
I have implemented wysiwyg inthe backend with the wysiwyg also inside joomfish.
The first part is pretty easily solved by searching the forum.
The second was a pain.
Lee Wilson said:Running latest JCE and K2 v2.2... This fix does not work... shame. Will have to look at Zoo me thinks.....
The first part is pretty easily solved by searching the forum.
The second was a pain.
Lee Wilson said:Running latest JCE and K2 v2.2... This fix does not work... shame. Will have to look at Zoo me thinks.....
16 years 6 months ago #68752
First, WYSIWYG is a function, not a field. When you use the tinymce or the tinymce clone JCE, you have only to attach a single Id and Class to th HTML an you got an editor for a textarea (tinymce is jquerry driven).
16 years 6 months ago #68753
I actually knew that ;) but when i used the original K2 method of injecting data inside joomfish after implementing my changes to the code they didn't appear in joomfish at all.
Lost a lot of time trying that way and i still don't know what went wrong.
What i finally did was to inject all the textarea extrafields my own way keeping field names.
If someone has succeeded in using the native method of injection please post or send a pm.
Titus said:First, WYSIWYG is a function, not a field. When you use the tinymce or the tinymce clone JCE, you have only to attach a single Id and Class to th HTML an you got an editor for a textarea (tinymce is jquerry driven).
Lost a lot of time trying that way and i still don't know what went wrong.
What i finally did was to inject all the textarea extrafields my own way keeping field names.
If someone has succeeded in using the native method of injection please post or send a pm.
Titus said:First, WYSIWYG is a function, not a field. When you use the tinymce or the tinymce clone JCE, you have only to attach a single Id and Class to th HTML an you got an editor for a textarea (tinymce is jquerry driven).
16 years 5 months ago #68754
Hello,
you have only to attach a single Id and Class to th HTML
??? would be nice to get a short information how we can manage this.
hopi
Titus said:First, WYSIWYG is a function, not a field. When you use the tinymce or the tinymce clone JCE, you have only to attach a single Id and Class to th HTML an you got an editor for a textarea (tinymce is jquerry driven).
you have only to attach a single Id and Class to th HTML
??? would be nice to get a short information how we can manage this.
hopi
Titus said:First, WYSIWYG is a function, not a field. When you use the tinymce or the tinymce clone JCE, you have only to attach a single Id and Class to th HTML an you got an editor for a textarea (tinymce is jquerry driven).
16 years 4 months ago #68755
For anybody not quite getting the expected results this might help
The hack code
if ( $rows[$i]->type=='wysiwyg' ){
$value=$object->value;
}
is for front end /model/item.php
Whereas the code:
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
is for the backend admin model/item.php (on mine this is line 492)
hth
The hack code
if ( $rows[$i]->type=='wysiwyg' ){
$value=$object->value;
}
is for front end /model/item.php
Whereas the code:
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
is for the backend admin model/item.php (on mine this is line 492)
hth
16 years 4 months ago #68756
Has this been added to the latest k2? It doesn't seem like it has, I have k2 v2.2 and Joomla 1.5.17. I managed to get it working, but the lines to replace are a bit different:
1/ Edit the administrator/components/com_k2/models/extrafield.php file
Line 186 :
Replace :
$output='';
With :
$editor =& JFactory::getEditor();
$output = $editor->display("K2ExtraField_".$extraField->id."", $active, '550', '400', '60', '20', false);
2/ Edit the administrator/components/com_k2/models/item.php file
Line 491 :
Replace :
$variables = JRequest::get('post');
with :
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
fidelis semper said:Well done.. has anybody even seen this? Thank you FaïWoueb, this works!!!! yo urock. thank you to K2!
FaïWoueb said:I found a solution ! 1/ Edit the administrator/components/com_k2/models/extrafield.php file
Line 164 :
Replace :
$output='';
By :
$editor =& JFactory::getEditor();
$output = $editor->display("K2ExtraField_".$extraField->id."", $active, '550', '400', '60', '20', false);
2/ Edit the administrator/components/com_k2/models/item.php file
Line 462 :
Replace :
$variables = JRequest::get('post');
By :
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
... and that's all folks.
1/ Edit the administrator/components/com_k2/models/extrafield.php file
Line 186 :
Replace :
$output='';
With :
$editor =& JFactory::getEditor();
$output = $editor->display("K2ExtraField_".$extraField->id."", $active, '550', '400', '60', '20', false);
2/ Edit the administrator/components/com_k2/models/item.php file
Line 491 :
Replace :
$variables = JRequest::get('post');
with :
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
fidelis semper said:Well done.. has anybody even seen this? Thank you FaïWoueb, this works!!!! yo urock. thank you to K2!
FaïWoueb said:I found a solution ! 1/ Edit the administrator/components/com_k2/models/extrafield.php file
Line 164 :
Replace :
$output='';
By :
$editor =& JFactory::getEditor();
$output = $editor->display("K2ExtraField_".$extraField->id."", $active, '550', '400', '60', '20', false);
2/ Edit the administrator/components/com_k2/models/item.php file
Line 462 :
Replace :
$variables = JRequest::get('post');
By :
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
... and that's all folks.
16 years 3 months ago #68757
Just for someone else finding this (A STICKY PERHAPS?)... the above solution is what I needed.
Essentially I don't care about a WYSIWYG, rather I wanted to be able to use HTML inside a field without it being stripped.
The above solution worked for me, thanks.
Essentially I don't care about a WYSIWYG, rather I wanted to be able to use HTML inside a field without it being stripped.
The above solution worked for me, thanks.
16 years 1 month ago #68758
Hello !
I'm happy to discover that in the last release (v 2.4.1), now it's possible to have a wysiwyg editor for extrafields.
But ... it remains 1 problem, the HTML is not save.
I keep my solution founded 1 year ago :
In the file "administrator/components/com_k2/models/item.php",
replace
$variables = JRequest::get('post', 4); - line 510 -
by
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
FaïWoueb said:I found a solution !
1/ Edit the administrator/components/com_k2/models/extrafield.php file
Line 164 :
Replace :
$output='';
By :
$editor =& JFactory::getEditor();
$output = $editor->display("K2ExtraField_".$extraField->id."", $active, '550', '400', '60', '20', false);
2/ Edit the administrator/components/com_k2/models/item.php file
Line 462 :
Replace :
$variables = JRequest::get('post');
By :
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
... and that's all folks.
I'm happy to discover that in the last release (v 2.4.1), now it's possible to have a wysiwyg editor for extrafields.
But ... it remains 1 problem, the HTML is not save.
I keep my solution founded 1 year ago :
In the file "administrator/components/com_k2/models/item.php",
replace
$variables = JRequest::get('post', 4); - line 510 -
by
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
FaïWoueb said:I found a solution !
1/ Edit the administrator/components/com_k2/models/extrafield.php file
Line 164 :
Replace :
$output='';
By :
$editor =& JFactory::getEditor();
$output = $editor->display("K2ExtraField_".$extraField->id."", $active, '550', '400', '60', '20', false);
2/ Edit the administrator/components/com_k2/models/item.php file
Line 462 :
Replace :
$variables = JRequest::get('post');
By :
$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
... and that's all folks.
15 years 4 months ago #68759
Hi,
I am having troubles adding {gallery},{/gallery} code to extra fields in K2 2.4.1 ... it is just outputting the syntax. It works fine on the content tab but not the extra field tab?
Anyone know what I can try ... I've tried most of the above, what am I missing?
I am having troubles adding {gallery},{/gallery} code to extra fields in K2 2.4.1 ... it is just outputting the syntax. It works fine on the content tab but not the extra field tab?
Anyone know what I can try ... I've tried most of the above, what am I missing?
15 years 1 month ago #68760
You just need to take $active[0] instead of $active, these changes work for me:
1/ Edit the administrator/components/com_k2/models/extrafield.php fileLine 208:Replace :$output='<textarea name="K2ExtraField_'.$extraField->id.'" id="K2ExtraField_'.$extraField->id.'" rows="10" cols="40" class="k2ExtraFieldEditor">'.$active[0].'</textarea>';By :$editor =& JFactory::getEditor();$output = $editor->display("K2ExtraField_".$extraField->id."", $active[0], '550', '400', '60', '20', false);2/ Edit the administrator/components/com_k2/models/item.php fileLine 511:Replace :$variables = JRequest::get('post');By :$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
Steve said:
I've been able to get the editor to show up using FaïWoueb's solution, but unfortunately NOTHING will save. The solo word "Array" appears in the text area and cannot be overwritten. Any idea what could be going on? I'm using k2 2.3.
1/ Edit the administrator/components/com_k2/models/extrafield.php fileLine 208:Replace :$output='<textarea name="K2ExtraField_'.$extraField->id.'" id="K2ExtraField_'.$extraField->id.'" rows="10" cols="40" class="k2ExtraFieldEditor">'.$active[0].'</textarea>';By :$editor =& JFactory::getEditor();$output = $editor->display("K2ExtraField_".$extraField->id."", $active[0], '550', '400', '60', '20', false);2/ Edit the administrator/components/com_k2/models/item.php fileLine 511:Replace :$variables = JRequest::get('post');By :$variables = JRequest::get('post',JREQUEST_ALLOWRAW);
Steve said:
I've been able to get the editor to show up using FaïWoueb's solution, but unfortunately NOTHING will save. The solo word "Array" appears in the text area and cannot be overwritten. Any idea what could be going on? I'm using k2 2.3.
Log in or create an account to reply.