Keyword

Adding HTML code into Extra Fields

  • Red Evolution
  • Red Evolution's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 11 months ago #76433 by Red Evolution
Adding HTML code into Extra Fields was created by Red Evolution
Hi,

Is it possible to allow HTML code to be added into extra fields. Currently this is 'zapped' when you save. I'd like to add RomanCart shopping cart code (HTML and Javascript) into extra fields.

cheers

d

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

More
14 years 11 months ago #76434 by ronildo
Replied by ronildo on topic Adding HTML code into Extra Fields
It is possible, but you have to hack K2 core files.
Here is a link: k2community.joomlaworks.gr/forum/topics/extra-wysiwyg-fields?x=1&id=3536014%3ATopic%3A1366&page=2#comments

I did that and it worked quit nice to me.

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

  • Red Evolution
  • Red Evolution's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 11 months ago #76435 by Red Evolution
Replied by Red Evolution on topic Adding HTML code into Extra Fields
I may be wrong but I don't think this is what I need. I want to past an HTML form into a simple text area (no WYSIWYG editor needed) and for the code to be untouched on save.

d

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

More
14 years 11 months ago #76436 by ronildo
Replied by ronildo on topic Adding HTML code into Extra Fields
Then just do second part:
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);

Try it.

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

  • Red Evolution
  • Red Evolution's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 11 months ago #76437 by Red Evolution
Replied by Red Evolution on topic Adding HTML code into Extra Fields
Fantastic, thanks. I wonder if this could be added to the global parameters so we don't create a non standard install of K2?

d

Ronildo Costa said:Then just do second part: 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);

Try it.

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

More
14 years 11 months ago #76438 by ronildo
Replied by ronildo on topic Adding HTML code into Extra Fields
Let's wait the new version... it supposed to be available this week.

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

  • Red Evolution
  • Red Evolution's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 11 months ago #76439 by Red Evolution
Replied by Red Evolution on topic Adding HTML code into Extra Fields
Good plan! ;) Thanks for your help, it's very much appreciated.

d

Ronildo Costa said:Let's wait the new version... it supposed to be available this week.

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

  • Red Evolution
  • Red Evolution's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 10 months ago #76440 by Red Evolution
Replied by Red Evolution on topic Adding HTML code into Extra Fields
For the record I tried this and it worked a treat!

d

Dave Robinson said:Good plan! ;) Thanks for your help, it's very much appreciated.
d

Ronildo Costa said:Let's wait the new version... it supposed to be available this week.

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

  • Red Evolution
  • Red Evolution's Avatar Topic Author
  • Offline
  • Premium Member
More
14 years 10 months ago #76441 by Red Evolution
Replied by Red Evolution on topic Adding HTML code into Extra Fields
To allow raw html in K2 v2.2 extra fields I've done this....

administrator/components/com_k2/models/item.php

line 491 replace this:

$variables = JRequest::get('post');

with this:

$variables = JRequest::get('post',JREQUEST_ALLOWRAW);

Hop this helps

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

More
14 years 10 months ago #76442 by ckka
Replied by ckka on topic Adding HTML code into Extra Fields
Thanks Dave.... I wish I would have seen your solution prior to posting. Worked for me.

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


Powered by Kunena Forum