Monday, March 28, 2011

Enable HTML in joomla k2 extra fields

K2 is a wonderful CCK and content replacement for the standard joomla content. In fact I am using it with k2mart to create some awesome shopping cart goodnes. Of course the shopping cart I am converting from is a Custom CMS/E-commerce system that has tons of custom html pieces in the product buy now pages.

Specifically I needed the ability to choose several custom messages that have little html to open new windows, highlight messages etc.

There are community links for an older version of k2 here

These don't work in the latest so here is an updated working html hax for K2 v2.4.1!

Open up Administrator/components/com_k2/models/extrafield.php

//line 32 
if (!$row->bind(JRequest::get('post')))
 

//around line 53 look for 
$objects = array ();
$values = JRequest::getVar('option_value');
$names = JRequest::getVar('option_name');

Replace with the following (if you have questions see documentation)
 //line 32 - replaced
if (!$row->bind(JRequest::get('post',JREQUEST_ALLOWHTML)))


//around line 53 - replaced
$objects = array ();
$values = JRequest::getVar('option_value','','post','string',JREQUEST_ALLOWRAW);
$names = JRequest::getVar('option_name','','post','string',JREQUEST_ALLOWRAW);
 


Stumble Upon CodePyro

201 comments:

«Oldest   ‹Older   201 – 201 of 201
Anonymous said...

Дорогие друзья, я нашел крутую ссылку на фото красивых девушек инстаграм! Зацените, это просто огонь! Я живу с этими картинками, каждый день поднимаю свой дух, и не только мой, но и других парней, которым показываю свои находки! Инстаграм просто пестрит красотой: глаза, улыбки, фигуры - все как надо! Фото девушек инстаграм манят и завораживают! Ты же не хочешь пропустить такое? Атмосфера там супер! Быстрее жми на ссылку тут! Лови кайф и наслаждайся!

«Oldest ‹Older   201 – 201 of 201   Newer› Newest»

Post a Comment