Testmodule

Forums: 
Drupalversie: 

Heb voor mezelf een heel simpele module gemaakt die normaal gezien een pagina moet weergeven op localhost/?q=test

Ik krijg ipv. page not found nu access denied. Ik neem aan dat ik een stap verder ben geraakt en de node effectief is aangemaakt, maar nu nog de rechten goed zetten. Wat zien jullie hier verkeerd in de code van mijn module. Ik krijg op de permissions page al wel iets te zien,

<?php

function testmodule_menu() {
$items['test'] = array(
'title' => 'testmodule',
'page callback' => 'testmodule',
);
return $items;
}
function testmodule() {
return '

'. t('Hallo het werkt') .'

';
}

function testmodule_permission() {
return array(
'administer testmodule' => array(
'title' => t('Administer testmodule'),
'description' => t('Allow users to administer test settings'),
),
'access testmodule content' => array(
'title' => t('Access test content'),
'description' => t('Allow users to access test content'),
),
);
}
?>

1) Je menu item is niet compleet genoeg. Er zit bijvoorbeeld geen access callback aan, wat wel verplicht is.
2) Waarom ontwikkel je nu al voor Drupal 7?
3) http://api.drupal.org. Dat is je bijbel. Bescherm deze met je leven.

Bedankt voor je reactie,

1)Hoe formuleer ik die acces callback dan? Op de drupal 7 API site staat er alleen dit over en geen voorbeeld erbij:

"access callback": A function returning a boolean value that determines whether the user has access rights to this menu item. Defaults to user_access() unless a value is inherited from a parent menu item.

Heb dit geprobeert: 'access callback' => 'user acces'
maar dan krijg ik alleen maar een heleboel errors....

2) Gewoon voor het plezier, zit niet echt een bedoeling achter.

3) Geef ik je volledig gelijk in

http://api.drupal.org/api/function/hook_menu/7 ;-) Staat alles over het gebruik van hook_menu().

Actuele inhoud

09 feb 2012

08 feb 2012

07 feb 2012

06 feb 2012

05 feb 2012

04 feb 2012