Answer the question
In order to leave comments, you need to log in
Question about your module. Where to dig?
Guys, guys, guys... Please tell me... Trying to make my own module...
<?php
/**
*
* Test my first module
*
*/
function test_menu() {
$items['admin/config/system/test'] = array(
'title' => 'Test Modul',
'description' => 'Hello, this my first module',
'page callback' => 'drupal_get_form',
'page arguments' => array('test_form'),
'access callback' => TRUE,
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
function test_form(){
$form['quantity_comments'] = array(
'#title' => t('Убрать количество комментариев в Тизере...'),
'#type' => 'checkbox',
);
$form['quantity_new_comments'] = array(
'#title' => t('Убрать количество новых комментариев в Тизере...'),
'#type' => 'checkbox',
);
$form['add_new_comments'] = array(
'#title' => t('Убрать "Добавить комментарий"...'),
'#type' => 'checkbox',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
return $form;
}
function test_form_submit($form,&$form_state){
if ($_POST['quantity_comments'] == TRUE) {
//Что тут должно быть...!!!
}
}
if ($teaser) {
unset($content['links']['comment']['#links']['comment-comments']);
}
Answer the question
In order to leave comments, you need to log in
ts, you need to use one of the Drupal API functions to define a system function hook in your module. to influence the material teaser, you need to use the following function:
https://api.drupal.org/api/drupal/modules!node!nod...
see hook_preprocess_node(&$vars). $vars contains a set of variables that will be available in node.tpl.php. Should be something like
function test_preprocess_node(&$vars) {
if ($vars['teaser']) {
unset($vars['content']['links']['comment']['#links']['comment-comments']);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question