2011-02-03 4 views
0

jCarousel을 사용하여 블록으로 표시되는 슬라이드 쇼를 만듭니다. 콘텐츠 유형에는 이미지 업로드 입력란이 있으며 해당 이미지는 캐 러셀에 표시됩니다. 나는 모든 노드가 컨베이어에서 다른 이미지를 원한다. 뷰에서는 유형별 필터를 정의했습니다. 하지만 모든 노드의 모든 이미지가 필요합니다. 이 문제를 어떻게 해결할 수 있습니까?jCarousel 모듈을 사용하여 슬라이드 쇼 만들기

답변

0

특정 페이지의 이미지를 해당 페이지를 통해 업로드하고 있습니까?

그렇다면 Node : NID 인수를 사용할 수 있습니다.

에서 "인수가없는 존재하는 경우 수행 할 작업"

검사가

후 "URL에서 노드 ID"

+0

감사합니다. 그게 내 문제를 해결해 줬어. :) 하나 더. 어떻게 슬라이드 쇼를 개별적으로 스타일링 할 수 있습니까? 예를 들어 한 유형의 페이지에서 슬라이드 쇼를 960 픽셀 너비로, 다른 유형을 600 픽셀로 사용하고 싶습니다. – eXoSaX

+0

template.php가 본문 클래스를 제공하고 page.tpl.php가 body 클래스를 호출하면 노드 유형별로 테마를 도울 수있는 .node-type- (nodetype) 클래스가 있습니다. – keva

0

여기에 template.php 주석에 대한 자세한 정보는의 "기본 인수를 제공" : page.tpl.php에서

추가

<body class="<?php print $body_classes; ?>">

in template.php

function phptemplate_preprocess_page(&$vars, $hook) { 
    // Classes for body element. Allows advanced theming based on context 
    // (home page, node of certain type, etc.) 
    $body_classes = array($vars['body_classes']); 
    if (!$vars['is_front']) { 

     // Add unique classes for each page and website section 
     $path = drupal_get_path_alias($_GET['q']); 
     list($section,) = explode('/', $path, 2); 
     $body_classes[] = phptemplate_id_safe('page-' . $path); 
     $body_classes[] = phptemplate_id_safe('section-' . $section); 
     if (arg(0) == 'node') { 
     if (arg(1) == 'add') { 
      if ($section == 'node') { 
      array_pop($body_classes); // Remove 'section-node' 
      } 
      $body_classes[] = 'node-add'; // Add 'node-add' 
     } 
     elseif (is_numeric(arg(1)) && (arg(2) == 'edit' || arg(2) == 'delete')) { 
      if ($section == 'node') { 
      array_pop($body_classes); // Remove 'section-node' 
      } 
      $body_classes[] = 'node-' . arg(2); // Add 'node-edit' or 'node-delete' 
     } 
     } 
    } 
    $vars['body_classes'] = implode(' ', $body_classes); // Concatenate with spaces 
    } 

    function phptemplate_id_safe($string) { 
    if (is_numeric($string{0})) { 
     // If the first character is numeric, add 'n' in front 
     $string = 'n'. $string; 
    } 
    return strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string)); 
    }