无法在单个节点中使用多个图像在视图中创建幻灯片

发布于 2024-10-26 16:02:48 字数 356 浏览 1 评论 0 原文

首先看看我的节点设置:https://i.sstatic.net/irhpy.jpg

第一个图像是我的子页面滑块内容类型,它接受多个图像,本质上是我的幻灯片。

第二个图像是默认页面,但我添加了对子页面滑块节点的节点引用。它允许您将特定幻灯片关联到页面。

最后一张图片我在用视图和视图幻灯片搞乱,但我不知道我在做什么。我设法显示图像,但正如你所看到的,它显示了很长的垂直图像。我设置了视图幻灯片,它在多个节点之间创建一张幻灯片,而不是在一个节点中创建多个图像。

我该去哪里?

谢谢

First take a look at my node setup here: https://i.sstatic.net/irhpy.jpg

The first image is my Subpage slider content type which accepts multiple images and will essentially be my slideshow.

Second image is the default page, but I added a node reference to the Subpage slider node. It allows you to associate a particular slideshow to a page.

The last image I was messing around with Views and Views Slideshow, but I don't know what I'm doing. I managed to get images displayed, but as you can see it displays the images of a long vertically. I set the Views slideshow and it creates a slide between multiple nodes and not the multiple images in ONE node.

Where do I go from here?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

¢好甜 2024-11-02 16:02:48

要在查看页面时显示带有图像幻灯片(来自引用的节点)的块

我想出了一种更简单(“duh”时刻)的方法来执行此操作。我在新安装的 Drupal 上创建了该功能。假设您有以下模块:CCK(启用节点引用)、视图视图幻灯片, 文件字段, 图像字段

  1. 创建您的内容类型(在本例中:滑块并使用核心页面类型)
  2. 将图像字段添加到滑块内容类型(字段应为名为 field_images
  3. 将节点引用字段添加到核心 page 内容类型(字段应命名为 field_slide_ref
  4. 编辑节点引用字段设置(可以如果您愿意,请删除“必填”)
    节点参考设置
  5. 幻灯片中创建一个名为slideshow的新视图
  6. 在 看法:
    • 基本设置->样式更改为“幻灯片放映”
    • 添加“内容:图像”字段(选择底部的格式:图像,除非使用
    • 添加“块”显示
  7. example.com/ 启用标记为“slideshow: Block”的新块admin/build/block

如果配置正确,当查看 _slide_ref_ 字段引用 slider 节点的页面时,您应该会看到块中显示的幻灯片。


旧解决方案...

要在正在查看的页面节点内部显示引用的幻灯片:

  1. 下载、安装并启用视图参考模块
  2. 使用多个图像创建内容类型(子页面滑块)[完成]
  3. 在视图 UI 中创建新的“页面”视图。添加字段内容:YOUR_IMAGEFIELD(从子页面滑块)重要:不要对图像进行分组,在基本设置->样式下选择“ Slideshow”并添加 Node: nid 参数,选择Provide default argument->Node ID from URL作为参数设置
  4. 页面< /em> 内容类型,您要在其中查看幻灯片并选择可引用的视图,并在“参数”字段集中检查:允许分隔符分隔值,然后单击“保存字段设置”

现在,当您创建默认页面时,将有一个视图参考字段来选择您要使用的视图,以及一个参数字段,您可以在其中输入包含要显示的图像的节点的节点 ID作为页面中的幻灯片。

To display a block with a slideshow of images (from a referenced node) when viewing a page

I have come up with a much easier ("duh" moment) way of doing this. I created the functionality on a fresh Drupal install. Assuming you have the following modules: CCK (w/ Node Reference enabled), Views, Views Slideshow, FileField, ImageField.

  1. Create your content types (in this case: slider and using the core page type)
  2. Add an imagefield to the slider content type (field should be named field_images)
  3. Add a node reference field to the core page content type (field should be named field_slide_ref)
  4. Edit the node reference field settings (can remove "Required" if you like)
    Node reference settings
  5. Create a new view called slideshow
  6. In the slideshow view:
    • Change Basic Settings->Style to "Slideshow"
    • Add the field "Content: images" (choose Format: Image at bottom, unless using ImageCache)
    • Add an argument of "Node: Nid" with the settings:
      Argument Settings
    • Add a "block" display
  7. Enable your new block labeled "slideshow: Block" at example.com/admin/build/block

If configured correctly, when viewing a page with the _slide_ref_ field referencing a slider node, you should see the slideshow displayed in the block.


Old Solution...

To display a referenced slideshow inside the page node being viewed:

  1. Download, install and enable the View Reference module
  2. Create your content type with multiple images (Subpage slider) [Done]
  3. Create a new "page" view in Views UI. Add the field Content: YOUR_IMAGEFIELD (from Subpage slider) important: don't group the images, under Basic Settings->Style choose "Slideshow" and add an Argument of Node: nid choosing Provide default argument->Node ID from URL as argument settings
  4. Create a view reference field on your page content type where you want to see the slideshow and select the view(s) that can be referenced and in the "Arguments" fieldset check: Allow delimiter seperated values and click "Save field settings"

Now when you create a default page there will be a view reference field to select the view you want to use and an argument field where you can input the node id of the node with your images you want to show as a slideshow in your page.

伴我心暖 2024-11-02 16:02:48

快速解决方案:视图幻灯片文档应该采用一种非常简单的调整,以可怕的粗体哥特式书写:

如果您想从一个节点的图像字段幻灯片显示多个图像**,请不要忘记取消选中“组多个” “您的视图>字段>您的图像字段设置中的值”复选框**

THE QUICK SOLUTION: a really simple tweak which the Views Slideshow docs should put in lurid bold gothic writing:

If you want to slideshow multiple images from an image field of one node ** don't forget to untick the "Group multiple values" checkbox in the settings for your-view>Fields>your-image-field **

红焚 2024-11-02 16:02:48

本节概述了如何制作从一个节点拍摄的图像的幻灯片。这里的要点是,您必须创建一个块,该块具有从 url 获取的节点 id 参数。我用它制作了一个幻灯片,在主要内容区域中显示为一个块,但您当然可以将该块放在任何地方。

模块:

CCK
图像场
观点
views_slideshow 或 jCarosel

  1. 使用图像字段创建内容类型,允许多个值。

    1. 使用多个图像创建内容,这些图像足够清晰,以便您可以判断这些图像是来自一个特定节点还是另一个节点
  2. 创建一个新视图作为节点。

    1. 创建块显示
    2. 为您的区块命名(在“区块设置”左栏下)
    3. 过滤方式:已发布、您的内容类型和图像字段(重要 - 请参阅最后一步原因)。
    4. 字段:您的图像字段。

      1. 请务必取消选中“对多个值进行分组”复选框
      2. 显示为图像或图像缓存预设。随心所欲
    5. 添加参数:

      1. 节点:NID
      2. 对于“参数不存在时采取的操作”,选择“提供默认参数”

      3. 来自 URL 的节点 ID

    6. 在“基本设置”下选择

      1. 如果使用views_slideshow,请将样式选择为:幻灯片(单帧)。
      2. 要显示的项目:无限制
    7. 保存您的视图
  3. 转到您的块页面 (/admin/build/block) 并将新创建的块放入主要内容区域(或您想要的任何位置)。如果您需要设置实际块本身(/admin/build/block)的可见性,请继续,但否则只有具有多个图像的内容类型的节点才会显示图像的幻灯片,而站点上的其他页面则不会。这就是为什么设置特定过滤器并使用参数很重要。
    完毕!

本质上,它不能作为页面工作,而必须是块。幻灯片将使用 NID 来查看该节点中的图像并仅创建这些图像的幻灯片。

在 Drupal 7 中应该同样工作,但尚未对此进行测试。

This outlines how to make a slideshow of images that are taken from one node. The main point here is that you have to make a block that has an argument of node id taken from the url. I used this to make a slideshow showing as a block in the main content area, but you can of course put the block anywhere.

Modules:

CCK
imagefield
views
views_slideshow OR jCarosel

  1. Create your Content Type with an image field, allowing multiple values.

    1. Create content with multiple images, distinct enough so that you can tell if the images are from one particular node or another node
  2. Create a new view as a node.

    1. Create a Block display
    2. Give your block a name (under Block Settings, left column)
    3. Filter as: published, as your Content Type and with the image field (important - see last step why).
    4. Field: your image field.

      1. Make sure to uncheck the 'Group multiple values' checkbox
      2. Display as an image, or an imagecache preset. Whatever you like
    5. Add an argument:

      1. Node: NID
      2. For 'Action to take if argument is not present', select 'Provide Default Argument'

      3. Node ID from URL

    6. Under 'Basic Settings' select

      1. If using views_slideshow, select the Style to be: Slideshow (Single-frame).
      2. Items to display: unlimited
    7. Save your View
  3. Go to your Blocks page (/admin/build/block) and place your newly created block into the main content area (or wherever you want it to be). If you need to set the visibility on the actual block itself (/admin/build/block) then go ahead but otherwise only nodes of the content type that has multiple images will show the slideshow of images, while other pages on your site will not. This is why it is important to set a specific filter and to use the argument.
    Done!

Essentially, this does not work as a page but has to be a block. The slideshow will use the NID to see what images are in that node and create a slideshow of those only.

Should work the same in Drupal 7 but have not tested this.

月光色 2024-11-02 16:02:48

解决方案是添加“slideref field”而不是“node id”作为参数,并提供默认参数“nid by url”,然后按节点进行幻灯片放映即可。

您也可以使用视图 Nivo 滑块。

The solution is to add as argument not the 'node id' but the 'slideref field' and provide default argument 'nid by url' and the slideshow by node will work.

You can use the Views Nivo Slider as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文