나는 내 드루팔 7 template.php
파일에 다음 코드가 있습니다드루팔 7 preprocess_views 작동하지
function mytheme_preprocess_views_view__videos__videos(&$vars) {
drupal_add_css(drupal_get_path('theme', 'mytheme') . "/css/qwembed-jquery-1.0.css");
drupal_add_js(drupal_get_path('theme', 'mytheme').'/js/jquery.swfobject.1-1-1.min.js', array('type' => 'file', 'scope' => 'footer'));
drupal_add_js(drupal_get_path('theme', 'mytheme').'/js/qwembed-jquery-1.0.js', array('type' => 'file', 'scope' => 'footer'));
}
내가이 CSS를로드 JS이보기가 표시되어있는 경우에만 제출해야합니다.
뷰 디스플레이 이름은 다음과 같습니다 Videos
보기 컴퓨터 이름은 다음과 같습니다 videos
및 재정의 파일은 다음과 같습니다
views-view--videos--videos.tpl.php
views-view-unformatted--videos--videos.tpl.php
views-view-fields--videos--videos.tpl.php
어떤 아이디어가 왜 작동하지?
이중'__videos__videos'는 오타가 아닙니까? 뷰 이름이 'videos'인 경우,'[yourThemeName] _preprocess_views_view__videos (& $ vars)'를 기대합니다. –
나는 disply 이름이 비디오이고이 경우 기계 이름이 비디오이기 때문에 나는 asumed했다. 위에 나열된 템플릿 파일은 완벽하게 작동하며 비디오 - 비디오입니다. 나는 경우에 대비하여 어쨌든 하나 제거하려고합니다. 감사합니다 – Cybercampbell
잠깐 만요, 나는 뭔가로 착각했다고 생각합니다. 그래서 나는 단지 하나의 '__videos'와도 일하지 않을 것이라고 추측합니다. 다시 점검하고 답을 추가합니다. –