나는 확실히 양식이 아니지만 일부 콜백 함수를 사용하여 외부 소스 및 디스플레이에서 데이터를로드해야합니다 (예 : 캠퍼스의 건물 목록과 해당 건물의 목록). 접근성 정보).Drupal 모듈 개발 hook_menu() 반자동 페이지의 경우
내가 필요한 것은 방문 목록 페이지 (모든 건물 목록)와 '개별 건물보기'페이지입니다. 또한, 학생 ID를 펀치하고 테스트 절차에 대한 정보를 볼 수있는 페이지가 있습니다. 그리고 마지막으로 기본적으로 양식 인 페이지가 있습니다 (이전에 성공적으로 완료했습니다).
Now, I HAD 건물 목록이 작동하지만 작은 변화가 있었고 작동이 멈췄습니다.
현재 내 hook_menu() 함수는 다음과 같습니다 : 나는 "캠퍼스 접근성 가이드"에 대한 메뉴 항목을 만든해야합니다 일부 변경하기 전에
<?php
/**
* Implementation of hook_menu()
*/
function disability_menu()
{
$items = array();
// Ignore me, shell
$items['quickreg'] = array(
'title' => 'Quick Registration',
'description' => t(''),
'page callback' => 'drupal_get_form',
'page arguments' => array(),
'file' => 'disability.quickreg.view.inc',
'access arguments' => array('access quick registration system'),
'type' => MENU_SUGGESTED_ITEM,
);
$items['tests/status'] = array(
'title' => 'Test Status Results',
'description' => t('Check on the status of your tests'),
'page callback' => 'disability_view_testing_status',
'page arguments' => array(),
'file' => 'disability.tests.view.inc',
'access arguments' => array('access test check information'),
'type' => MENU_CALLBACK,
);
$items['tests'] = array(
'title' => 'Testing Services',
'description' => t('Check on the status of your tests'),
'page callback' => 'disability_view_testing',
'page arguments' => array(),
'file' => 'disability.tests.view.inc',
'access arguments' => array('access test check information'),
'type' => MENU_SUGGESTED_ITEM,
);
$items['access/%building'] = array(
'title' => 'Campus Accessibility Guide',
'description' => t('A summary list of detailed accessibliity information about each building on the A&M campus'),
'page callback' => 'disability_view_access',
'page arguments' => array(1),
'file' => 'disability.access.view.inc',
'access arguments' => array('access building access information'),
'type' => MENU_SUGGESTED_ITEM,
);
return $items;
}
가 (물론 활성화 된 후)가 제대로 표시됩니다. 12345
이제 access/%building
메뉴 항목도 나타나지 않습니다 심지어 리디렉션 순환에 URL /access
를 보내는 /access
URL은 모든 건물의 목록을 표시 제대로 작동 할과 /access/12345
제대로 ID 번호의 단일 레코드를 표시 할 것 (ID가 존재하지 않을 때 /access
으로 리다이렉트하는 뷰 특정 함수로 전송하는 ID는 으로 전달한다고 생각하게 만듭니다.)
누구나 내가 잘못하고 있거나 2 가지 테마 페이지를 지원하기 위해해야 할 일을 말해 줄 수 있습니까? /access
및 /access/%building
URL 패턴?
'% building'을 (를) 채우는'build_load()'함수가 있습니까? – ceejayoz
@ceejayoz 콜백 함수에서 방금로드하는 것처럼 building_load() 함수가 없습니다. 방금'%'로 떨어 뜨리거나'building_load()'를 만들면 더 좋을까요? – dcousineau