Unable to use multiple images in a single node to create a a slideshow in Views
First take a look at my node setup here: http://imgur.com/a/DJdRw
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.
开发者_JAVA技巧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
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.
- Create your content types (in this case: slider and using the core page type)
- Add an imagefield to the slider content type (field should be named
field_images
) - Add a node reference field to the core page content type (field should be named
field_slide_ref
) - Edit the node reference field settings (can remove "Required" if you like)
- Create a new view called slideshow
- 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:
- Add a "block" display
- Change
- 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:
- Download, install and enable the View Reference module
- Create your content type with multiple images (Subpage slider) [Done]
- Create a new "page" view in Views UI. Add the field
Content: YOUR_IMAGEFIELD
(from Subpage slider) important: don't group the images, underBasic Settings->Style
choose "Slideshow" and add an Argument ofNode: nid
choosingProvide default argument->Node ID from URL
as argument settings - 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.
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 **
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
Create your Content Type with an image field, allowing multiple values.
- Create content with multiple images, distinct enough so that you can tell if the images are from one particular node or another node
Create a new view as a node.
- Create a Block display
- Give your block a name (under Block Settings, left column)
- Filter as: published, as your Content Type and with the image field (important - see last step why).
Field: your image field.
- Make sure to uncheck the 'Group multiple values' checkbox
- Display as an image, or an imagecache preset. Whatever you like
Add an argument:
- Node: NID
For 'Action to take if argument is not present', select 'Provide Default Argument'
Node ID from URL
Under 'Basic Settings' select
- If using views_slideshow, select the Style to be: Slideshow (Single-frame).
- Items to display: unlimited
- Save your View
- 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.
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.
精彩评论