Simplenews default body content ofr content

daily materio html template through hook_form_alter
This commit is contained in:
Bachir Soussi Chiadmi
2014-04-23 16:49:49 +02:00
parent 100abc9a3a
commit 4d0605604f
2 changed files with 163 additions and 0 deletions

View File

@@ -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');
}