checkbox in a flexicontent_field plg ??

More
14 years 3 months ago #2116 by devil
Hi,

how can i make an checkbox in a flexicontent_field plg?

Code:
function onDisplayField(&$field, $item) { // execute the code only if the field type match the plugin type if($field->field_type != 'jcomments') return; $checked = ""; if ($field->value['nocomment'] == "1") { $checked = ' checked="checked"'; } // get the JComments Class if (file_exists(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php')) { $field->html = '<div>JComments Field Plugin</div>'; //$field->value['nocomment'] = 1; $field->html .= '<label><input type="checkbox" name="nocomment[]" value="'.$field->value['nocomment'].'" id="nocomment_0"'.$checked.'/>Disable Comments for this item.'.$value['nocomment'].'</label>'; }else{ $field->html = '<div style="color:red";>Please install JComments Component</div>'; } }

Joomla-Aktuell - www.joomla-aktuell.de

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.259 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline