[gelöst] hook_theme Problem mit 2 oder mehreren Templates
am 16.09.2010 - 20:58 Uhr in
hallo ,
ich benutze hook_theme() Funktion um mein node/add Formular zu themen.
Dies funktioniert auch so lange ich nur einen Inhalttyp theme. Wenn ich aber ein zweites Formular (Inhalttyp_2) themen will,
dann geht das plötzlich nicht mehr. Bisher verwendete ich diese Funktion:
function meinetheme_theme($existing, $type, $theme, $path) {
return array('inhalttyp1_node_form' => array('arguments' => array('form' => NULL),'template' => 'inhalttyp1-node-form',),);
}das ging dann auch. So , jetzt kommt auch Inhalttyp_2 ins Spiel und das Ganze will nicht mehr tun:
function meinetheme_theme($existing, $type, $theme, $path) {
$output = array();
$output = array('inhalttyp1_node_form' => array('arguments' => array('form' => NULL),'template' => 'inhalttyp1-node-form',),);
$output = array('inhalttyp2_node_form' => array('arguments' => array('form' => NULL),'template' => 'inhalttyp2-node-form',),);
return $output;
}Hat jemand eine Idee wie man das lösen könnte?
Danke
- Anmelden oder Registrieren um Kommentare zu schreiben

Versuchs mal so:function
am 16.09.2010 - 21:25 Uhr
Versuchs mal so:
function meinetheme_theme($existing, $type, $theme, $path) {
$output = array();
$output[] = array('inhalttyp1_node_form' => array('arguments' => array('form' => NULL),'template' => 'inhalttyp1-node-form',),);
$output[] = array('inhalttyp2_node_form' => array('arguments' => array('form' => NULL),'template' => 'inhalttyp2-node-form',),);
return $output;
}
Beste Grüße
Werner
danke, es geht nich so wie Du
am 16.09.2010 - 21:49 Uhr
danke,
es geht nich so wie Du schriebst, sondern so;
function meinetheme_theme($existing, $type, $theme, $path) {
return array('inhalttyp1_node_form' => array('arguments' => array('form' => NULL),'template' => 'inhalttyp1-node-form',),
'inhalttyp2_node_form' => array('arguments' => array('form' => NULL),'template' => 'inhalttyp2-node-form',));
}
Arrays bei PHP haben mir schon immer interessiert, aber auch schon immer drucheinander gebracht...... Kopfschütteln ........