Skip Navigation

[Resolved] upgrade to Views 1.11.1 breaks bxslider

This support ticket is created 8 years, 5 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Beda 8 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#347222
views.1.11.1.jpg
views.1.10.1.jpg

I am trying to: upgrade to Views 1.11.1

I visited this URL: jemwoodworking.com and jemwoodworking.com/project-gallery/classical/

I expected to see: sliders

Instead, I got: all the slider images stacked vertically

When I upgrade jemwoodworking.com from Views 1.10.1 to Views 1.11 or Views 1.11.1, all the sliders break. The sliders are built using the Aspen Shortcodes and Widgets plugin, which in turn uses bxslider.

The page source for the home page doesn't appear to change between these Views versions, so I'm guessing it's a javascript problem.

I had to revert the site to Views 1.10.1 to fix this, so you won't see the problem when you visit the site.

#347389

Thank you for contacting us here in the Support Forum and for providing the Debug Informations

I assume you did not use native Views Slider features to build those sliders?

We have had to add some default HTML around every Views Loop, and this might brake your Sliders, if you used Views to DELIVER the content (Images) and used them in a Third party Plugin to populate the actual slider.

Solutions:

1. Build the Slider with Views features:
https://toolset.com/documentation/user-guides/creating-sliders-with-types-and-views/

2. If you need a "raw output" of your View and do not use pagination, query, parametric search etc on those Views, please let me know the I can provide you a Custom Code filter that returns the Views loop output "clean" with no default HTML wrapped mourn it.

Please don't hesitate to inform me in case the issue persists

Thank you for your patience.

#347696

Your response makes me wonder how carefully you read my message.

I stated that I used the Aspen Shortcodes and Widgets plugin to build the sliders. This should also be obvious from the subject line of my message.

I stated that the HTML output for the pages with sliders is the same before and after the upgrade from Views 1.10.1 to 1.11.1.

Views built-in sliders might work for the home page, but they are not a viable solution for the project gallery pages.

#347699

Yes, I understood that you use those plugins.

I assumed, you did not build the Sliders with Views directly, but populate your Custom Sliders with Views generated content, even if using 3rd Party Plugins.

I suspected you populate your Sliders with Views generated output, and this would be broken since Views 1.11 due to what I elaborated in the previous answer.

If I understand correctly now, you do not use at all Views to build or populate those sliders.
I apologize if I had wrongly understood your initial issue-report.

Do you have any JS errors in your Console with the new Views Plugin?

Could you test it with a minimal set of plugins and a WordPress default theme to see if the issue persists, and when it is re-introduced?
Sometimes specific mixes of plugins can cause issues that seem related to one plugin only, but in fact are due to the specific "mix"

I would in the best case need a Duplicator Package if this issue persist on a minimal environment

We usually recommend the free Plugin "Duplicator" for this porpoise.

If you already know how Duplicator works
(http://wordpress.org/plugins/duplicator/),
please skip the following steps and just send me the installer file and the zipped package you downloaded.

★ Duplicator Instructions
hidden link
Send me both files (you probably want to use DropBox, Google Drive, or similar services, as the snapshot file will be quite big)

❌ IMPORTANT ❌
Remember to create or keep an admin account for me before creating the snapshot, or I won't be able to login. You may delete the new admin account once the snapshot has been built.

I will enable your next answer as private so you can provide me the information securely.

Please could you provide me the additional Infos?

Thank you for your patience.

#347880

Thanks for the Details

1. Yes, I am using Views generated output for the slider, but not Views native sliders.

This confirms what I suspected here:
https://toolset.com/forums/topic/upgrade-to-views-1-11-1-breaks-bxslider/#post-347389

You are using Views to Provide Data, instead of Render Data.

The purpose of Views was and is, to render Data, and not to populate other elements with it.

Since Views 1.11 we have had to wrap Views loop outputs in default HTML and CSS/JS in order to support things like infinite scrolling, and future to come features like "Front End Sorting and Ordering"

This will not be reverted, and it is not a BUG per se but basically it was never intended to use Views as a Data Provider.

Though, given the large usage of Views as a Data Provider, our DEV Team is currently developing a specific View Setting in order to do exactly this:
Provide raw data for later use.

This is a new feature and I can not state any ETA on this, other than that it is under development for future releases.

By now, the only way to return a "clean" Loop output is using the below filter:

add_filter( 'wpv_filter_wpv_view_shortcode_output', 'prefix_clean_view_output', 5, 2 );

function prefix_clean_view_output( $out, $id ) {
    if ( $id == '375' ) { //Please adjust to your Views ID
        $start = strpos( $out, '<!-- wpv-loop-start -->' );
        if ( 
            $start !== false
            && strrpos( $out, '<!-- wpv-loop-end -->', $start ) !== false
        ) {
            $start = $start + strlen( '<!-- wpv-loop-start -->' );
            $out = substr( $out , $start );
            $end = strrpos( $out, '<!-- wpv-loop-end -->' );
            $out = substr( $out, 0, $end );
        }
    }
    return $out;
}

This above code will not allow any settings in a View like parametric Search, AJAX Updates, scrolling, pagination, etc.
It will provide bare, raw results.

This code will allow you to populate your 3rd Party Software with content generated by Views.

I have to emphasize that this is not the intended way to use Views, being Views a "Data Render Engine" and not a "Data Provider".

Please let me know if the above solution works for you, I look forward to your reply!

Thank you for your patience.

#347900

Your code fixes the problem for me on a test site, thanks.

Was there an announcement that I missed about this?

Please let me know when you have an ETA on a View Setting for this.

#347961

Thank you for confirming it

There was no announcement in regard.

This was never intended to work this way, as Views is and was built as a Render Engine.

We are handling edge cases directly here in the Forum and are providing the above Code (for now) for the cases where Views has been used as a Data Provider.

As mentioned, I can unfortunately not state and ETA by now, it will require some Coding tasks and it is a new feature, therefore it must undergo every step as QA as other features too.

Please keep an eye on our Blog and Change-logs, we will announce this new feature once it is published, as it will be a by definition "new" feature of Views 🙂
https://toolset.com/blog/
https://toolset.com/download/views/#changelog

I am glad with the Custom Code the sliders are back to normal

Please do not hesitate to open a new thread if other issues or problems arise

Thank you for your patience.

#351173

Just keeping this issue open per the support cleanup robot.

#351392

Thanks for the Details

Do I understand it correctly that the issue is solved with the above Code?

I can not state a ETA on the new feature of View.

This will take it's time, once developed, it also needs to be tested and re-tested for best experience.

I suggest to keep an eye on our Blog, and the Changelog, to see when the feature is released.
https://toolset.com/blog/

Thank you very much for your understanding.

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