Skip Navigation

[Resolved] Remove all Views js and css

This thread is resolved. Here is a description of the problem and solution.

Problem:
Can Views CSS or JS that is enqueued natively by the Plugin be removed?

Solution:
There is no possibility to remove this, unless with Custom Code, which we cannot suggest.
Feature requests to allow more raw outputs of the Views are filed but it is not defined when they will be implemented.

This support ticket is created 6 years, 10 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 4 replies, has 2 voices.

Last updated by Paul 6 years, 10 months ago.

Assisted by: Beda.

Author
Posts
#610279

I can't believe how much js and css gets loaded with Views. It indiscriminately loads masses of things I don't want. It doesn't look like the plugin gives options to selectively turn scripts and styles off?

Please can you provide a comprehensive list of scripts and styles so I can dequeue them all without having to track them all down?

#610340

All the scripts loaded are needed by Toolset to work properly.

There are a few that are loaded always, and that is because the View will not know wether for example you have an AJAX pagination or similar things on the page loaded, until it's done loading.
And then, it's too late for certain scripts.

Hence, we need to enqueue them always and everywhere on the Site.

I cannot suggest to remove them, as the Plugin could stop working as expected.

#610356

Thanks Beda. I don't need pagination and if I do in the future I can decide not to dequeue scripts on pages that I know will need it. Also there looks to be some media element css/js loaded that I don't want. I definitely don't want Toolset styling anything.

I really just want to use Views to easily run queries on custom post types without having to write code. I want only the data from the posts outputted and only markup that I define. I don't want any css/js or extra markup added by Views. Is this possible please to provide a list of things to dequeue?

#610363

There is no way to completely remove this, as it's simply not designed with this purpose in mind.

As example, you will always have default HTML in the View Loop, no matter what the setup is.
That can be removed only with Custom Code and we do not suggest to do that.

I just replied such a request here to you:
https://toolset.com/forums/topic/cruft-output-by-views/#post-610342

It is not how Toolset should be used, and we cannot support such alterations, which will result in presumable BUG reports eventually.

You can, at your own risk, dequeue this scripts, but I cannot suggest to do it, and provide a list of scripts to remove, because all of them are needed, since included in the Plugin.

There are plans to allow raw output with Views, but that has no ETA yet.

If you wish, I can submit a feature request to document the scripts in Views and add or document the filters needed to dequeue them, But I can tell right now, that this will most likely be discarded for above reasons by the Developers themselves.

Asking doesn't hurt, thou, so if you wish, I can research this.

I apologize that I cannot be of any good help in this particular case.

#610368

OK yes please, submit request and thanks for the consideration. Raw output also sounds ideal.