WYSIWYG editor in custom field

  • Posts: 50
  • Thank you received: 0
11 years 4 months ago #112220

Hi,
I need subscript/superscript in a custom field. How do I go about this? What would it take to have a WYSIWYG editor in custom field?

Thanks!

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 4 months ago #112308

You would have to create a new custom field type via a system plugin. You would implement the onFieldsLoad trigger to add your type in HikaShop and add the class of your type in a myfieldtype_class.php file next to the main file of the plugin. That class would contain the different functions of a custom field type class: __construct getFieldName trans show display JSCheck check
I invite you to look at the file administrator/components/com_hikashop/classes/field.php for some examples.

class plgHikashopSubuserfield extends JPlugin
{
	function __construct(&$subject, $config) {
		parent::__construct($subject, $config);
    }

	function onFieldsLoad(&$fields) {
		$me = null;
		$me->name = 'myfieldtype';
		$me->text = 'My field type';
		$me->js = 'allTypes["plg.myfieldtype"] = new array("required","default","columnname");';
		$fields[] = $me;
	}
}
if(defined('HIKASHOP_COMPONENT')) {
	require_once( dirname(__FILE__).DS.'myfieldtype_class.php' );
}

The following user(s) said Thank You: ClickWebDesign

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

  • Posts: 50
  • Thank you received: 0
11 years 4 months ago #112318

Thanks Nicolas, very helpful reply, I'll check it out:)

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

Time to create page: 0.057 seconds
Powered by Kunena Forum