drupal이 특정 페이지에서 1.4를 사용하도록하는 방법을 찾고 있습니다. drupal jQuery 1.4 on specific pages특정 페이지의 drupal jQuery 1.4
그것은 내가 올바른 표시 대답을 시도하는 나에게 동안을 찾습니다
이이 오래된 질문과 동일합니다. 하지만 전반적으로 모듈 개발자가 처음이기 때문에 대답을 기반으로 파악할 수 없었습니다.
그 대답에서 코드는 다음처럼 보였다 :
/**
* Implementation of hook_theme_registry_alter().
* Based on the jquery_update module.
*
* Make this page preprocess function runs *last*,
* so that a theme can't call drupal_get_js().
*/
function MYMODULE_theme_registry_alter(&$theme_registry) {
if (isset($theme_registry['page'])) {
// See if our preprocess function is loaded, if so remove it.
if ($key = array_search('MYMODULE_preprocess_page',
$theme_registry['page']['preprocess functions'])) {
unset($theme_registry['page']['preprocess functions'][$key]);
}
// Now add it on at the end of the array so that it runs last.
$theme_registry['page']['preprocess functions'][] = 'MYMODULE_preprocess_page';
}
}
/**
* Implementation of moduleName_preprocess_hook().
* Based on the jquery_update module functions. *
* Strips out JS and CSS for a path.
*/
function MYMODULE_preprocess_page(&$variables, $arg = 'my_page', $delta=0) {
// I needed a one hit wonder. Can be altered to use function arguments
// to increase it's flexibility.
if(arg($delta) == $arg) {
$scripts = drupal_add_js();
$css = drupal_add_css();
// Only do this for pages that have JavaScript on them.
if (!empty($variables['scripts'])) {
$path = drupal_get_path('module', 'admin_menu');
unset($scripts['module'][$path . '/admin_menu.js']);
$variables['scripts'] = drupal_get_js('header', $scripts);
}
// Similar process for CSS but there are 2 Css realted variables.
// $variables['css'] and $variables['styles'] are both used.
if (!empty($variables['css'])) {
$path = drupal_get_path('module', 'admin_menu');
unset($css['all']['module'][$path . '/admin_menu.css']);
unset($css['all']['module'][$path . '/admin_menu.color.css']);
$variables['styles'] = drupal_get_css($css);
}
}
}
내가 '비디오'를 '블로그'과의 노드 유형에 대한 설정이 해제하는 jquery_update 1.3.2이 필요합니다. 누군가 나를 도울 수 있습니까?
감사합니다.
콘텐츠 유형을 확인하여 설정 해제 위치를 어떻게 알 수 있습니까? 지금은 arg를 통해 작동합니다. 감사합니다. – Mark
올바른 방법인지 확실하지 않지만 nid ($ _GET [ 'q'])를 기반으로 '유형'필드에 대해 '노드'테이블을 쿼리하면됩니다. –