Posted by mayur.pimple on December 3, 2011 at 6:05pm
Hi
im create cck field in content type.
in cck filed ,there is 2 option true/false
if true then comment form is enable and false then comment box disable.
Hi
im create cck field in content type.
in cck filed ,there is 2 option true/false
if true then comment form is enable and false then comment box disable.
Comments
Very easy. Use hook_nodeapi
Very easy. Use hook_nodeapi (http://api.drupal.org/api/drupal/developer--hooks--core.php/function/hoo...) and catch the insert event.
Then, as per the selected option (true/false), set the $node->comment value.
Thanks
thanks
thanks
It's can be done through hook_form_alter also.....
It's can be done through hook_form_alter also by just using depending on your condition whether you want to disable the comment box then use unset($form['comment']);
Hope it will help some one.
thanks
CODE
<?php
function hide_comment_form_alter(&$form, $form_state, $form_id)
{
global $node;
$node = node_load(arg(1));
switch ($node->type)
{
case 'page':
}
break;
}