Skip Navigation

[Resolved] Slider Shows all the images at once

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 8 replies, has 2 voices.

Last updated by John 7 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#486868

I am trying to display a gallery of images related to a single property.
I followed the technique in the movie as far as it went, but it was dedicated to WP Posts, not Custom Post Types. I am not sure that the filter is the working correctly, however, the images are the ones I was expecting.
My issue is that rather than seeing the images contained within a slider box with arrows and dots, I have all the images within the arrows.
The slide is called from a view, which uses a content template.
My code is below.
Please suggest a remedy.

<h1>This is a layout named Single Farm Archive</h1>
<h1>[types field='farm-name'][/types]</h1>
<p>[wpv-view name="farm-gallery"]</p>
<p>State: [types field='farm-state-select' output='raw'][/types] Status: [types field='status'  option='wpcf-fields-radio-option-261f47e073321dc2e7d6288d56cd5222-1']Active[/types] [types field='status'  option='wpcf-fields-radio-option-d649b1410d80d064ad0e82ad9d069580-1']Sold[/types] [types field='status'  option='wpcf-fields-radio-option-325627426b106233047814be14e92829-1']Under Contract[/types]</p>
<p>County: [types field='county'][/types] Farm Type: [types field='farm-type'][/types]<br />
Acreage: [types field='acreage'][/types]</p>
<p>Price [types field='price'][/types]</p>
<p>Description: [types field='general-description'][/types]</p>
<p>Contact: [types field='farm-contact'][/types]</p>
<p>Well Water?: [types field='well-water'][/types]<br />
Taxes: [types field='taxes'][/types]<br />
Zoning: [types field='zoning'][/types]</p>
<p>Location: [types field='location-description'][/types]</p>

Here is the code for the VIEW

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
	<wpv-loop>
			[wpv-post-body view_template="Farm Gallery - slide"]

	</wpv-loop>
		<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-pager-prev-page][wpml-string context="wpv-views"]Previous[/wpml-string][/wpv-pager-prev-page][wpv-pager-next-page][wpml-string context="wpv-views"]Next[/wpml-string][/wpv-pager-next-page][wpv-pager-nav-links ul_class="wpv_pagination_dots" li_class="wpv_pagination_dots_item" current_type="link"]
[wpv-layout-end]

And this is from the section labeled "templates for this view"

[wpv-post-link]
<h1>This is a Content Template named Farm-Gallery-slide</h1>
[types field='property-gallery' alt='%%ALT%%' title='%%TITLE%%' size='large' align='none' resize='proportional' separator=', '][/types]

Thank you.

#487045

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Please check following link where you will be able to see slider with dot and navigation buttons:
=> hidden link
[Section: "Featured articles"]

I suggest you should create a test site on disciver-wp.com and learn how above slider view is created. You can register test site to review how it was setup. It’s totally free.
=> https://toolset.com/faq/how-and-why-to-create-a-test-site-in-discover-wp/

You should create a test site for "Views tutorial – complete":
=> http://discover-wp.com/register/?site_type=829

#487262

Thank you for a reply that reflects a firm grasp of the obvious.

A better response would have entailed that I visit https://toolset.com/documentation/user-guides/creating-sliders-with-types-and-views/ and/or spent time on https://toolset.com/documentation/user-guides/getting-started-views/part-5-slider/
In addition to the links you mentioned I spent time with each of the above, but still have an issue getting the slides to appear correctly.

Perhaps you could refer my request to someone for whom reading the code would not be a challenge.

#487523

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can I've your test site access details and problem URL so that I can see whats causing the issue.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#488441

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please try to filter your view by post ID.
=> https://toolset.com/documentation/user-guides/filtering-views-query-by-post-id/

When calling your view:

[wpv-view name="your-view" ids="[wpv-post-id]"]

And add the query filter:

Select Posts with IDs set by the View shortcode attribute, and enter the name of the attribute you want to use, which defaults to ids.
#489268

Minesh,
I gleaned a clue from a support thread I saw at https://toolset.com/forums/topic/flexslider-show-all-images-from-custom-post-types/

Caridad said
<quote>"Views are used to list posts, the loop happens through all the filtered posts.

But in this case you are viewing a single portfolio post. So you need to use a Content Template instead.

I created a new Content Template called "Flex slider" with this in it:

<div id="flex-slider" class="flexslider-main flexslider">
<ul class="slides">
[wpv-post-body view_template="Flex slider - main slider - single slide"]
</ul>
</div>
 
<div id="flex-slider-carousel" class="flexslider flexslider-nav">
    <ul class="slides">
      [wpv-post-body view_template="Flex slider nav - thumbnails - single thumbnail"]
    </ul>
</div>

This code was copied from the Views. I also copied over the contents of the CSS and the JS boxes. And I was able to re-use the two "inside templates" as you can see above.

Then I inserted this Content Template into the Portfolio content template like this:
[wpv-post-body view_template="Flex slider"]

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have."
</quote>

I must confess that keeping up with the fluid definitions Toolset uses for Layouts versus Content Templates versus Views often leaves me wondering "which one is in charge?"

I believe she has identified the issue.
When I use a link to display a particular farm, for example, inside of a view that filtered farms belonging to a particular state, the link to the farm would be <p class="farm_name">Farm Name: <a href="[wpv-post-url]">[types field='farm-name'][/types]</a>

That link loads what the system says is "Layouts being used as templates for post types "which displays a single page. Inside the Visual editor cell, I can insert either a View or a Content Template.
I have installed FlexSlider version 2.6.3.
The images I want are in the the farm's property media images gallery field, which is a repeating field.
What is the best way to query those images and show them in FLexSlider?

Thank you.

#489359

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - the ticket you shared is too old.

To clear your doubt for views and content template I suggest you should refer the following Doc:
=> https://toolset.com/faq/whats-the-difference-between-a-view-and-a-view-template/

When you say query the images - I would like to know using which approach you want to display repeating image - using Toolset Shortcode or PHP API?

If you want to display repeating image using Toolset shortcode, you can use [wpv-for-each] shortcode:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-for-each

More info:
=> https://toolset.com/documentation/user-guides/displaying-wordpress-custom-fields/repeating-fields/#Displaying Repeating Fields

#490872

I believe my problem lies with FlexSlider 2. Although the correct images get processed onto the screen, the jQuery doesn't fire. This was working in a previous site that I built, but recently stopped after I updated, so I suspect it's either a Views problem or a WordPress version issue.

Let me know if you are aware of a replacement for FlexSlider.
Toolset really needs a better model for this because all of your slider tutorials assume posts without repeating images.

#491088

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - it could be the possibility but to know the issue I need temporary access details so that I can check on your install what's going wrong and report to our concern team.

Is it possible for you to send me access details?
Do you see any javascript error on your browser console?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.