Simplenews default body content ofr content
daily materio html template through hook_form_alter
This commit is contained in:
@@ -36,3 +36,23 @@ function materio_admin_menu_alter(&$items){
|
||||
# deactivate default home page
|
||||
$items['node']['access callback'] = FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Implements hook_form_alter().
|
||||
*/
|
||||
function materio_admin_form_simplenews_node_form_alter(&$form, &$form_state, $form_id) {
|
||||
// dsm($form_id, '$form_id');
|
||||
// dsm($form_state, '$form_state');
|
||||
// dsm($form, '$form');
|
||||
if(!$form['nid']['#value']){
|
||||
$form['body']['und'][0]['#default_value'] = materio_admin_getSimplenewsNodBodyTemplate();
|
||||
$form['body']['und'][0]['#rows'] = 50;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function materio_admin_getSimplenewsNodBodyTemplate(){
|
||||
return file_get_contents(drupal_get_path('module', 'materio_admin').'/templates/simplenews_node_template.html');
|
||||
}
|
||||
Reference in New Issue
Block a user