0

現在のプロジェクトでは、ギャラリーの詳細ページを表示するために特定のビューを設定する必要があります。これは次のように機能するはずです。

1. User clicked a node (costum-post-type: gallery)
2. User received an overview page with linked images
3. User clicked an image
4. User received the gallery page (gallerific view)

手順1〜3が完了しました。しかし、Drupalに概要ページのデータを使用して詳細ページを作成させるにはどうすればよいですか?

たとえば、次のようなものです:http://example.com/gallery-1/detailまたはhttp://example.com/gallery-2/detail

/gallery-nはリンクされた画像の概要ページであり、detailはの詳細ページです/gallery-n

私が何を意味するのか理解していただければ幸いです。

編集

概要ページには、詳細ギャラリー(jquery galleriffic)ページにリンクされている一連のサムイルがあります。

4

2 に答える 2

1

作成した(またはすでに持っている)カスタムモジュールで、次のようなことを試すことができます。メニューで目的のページへのパスを設定し、関数を呼び出すコールバックとして設定すると、何でもレンダリングできます。欲しい、または好きなように電話してください。

function MODULENAME_menu() {
  $items = array();
  $items['gallery/%/detail'] = array(
    'title' => 'Gallery Detail',
    'page callback' => 'MODULENAME_gallery_detail_page',
    'page arguments' => array(1),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK
  );
  return $items;
}

function MODULENAME_gallery_detail_page($gallery_id) {
  // Here you can render the view as a page, using the gallery
  // id which you passed as a parameter to this function.
  // So Change MYCUSTOMVIEW to the view you want to render
  $view = views_get_view('MYCUSTOMVIEW');
  print views_build_view('page', $view, array(), false, false);
}

モジュール名をモジュールの名前に変更するだけです。views_build_viewを呼び出すときにいくつかの作業が必要になる場合がありますが、それは開始点である必要があります。必要に応じて、さらにいくつか質問することができます。サポートさせていただきます。

于 2010-10-05T07:55:37.100 に答える
1

私があなたの問題を正しく理解しているなら、あなたはこのことをするべきです。

 1. Create view1 for page with linked images. It should be page display with http://example.com/images/%nid
   where %nid is nid argument of gallery. 
 2. Create view2 for gallery detailed page. it should be page display with http://example.com/%nid/detail 
 3. Theme that views as you want.
 4. For view1 for image field use override output in field settings to make it links to %nid/detail

PS必要に応じて関係を使用します。説明が明確でない場合は、お気軽にご記入ください。

于 2010-10-05T18:21:41.390 に答える