0

I'm writing a custom dashboard plugin using vue js and boostrap 5. I've noticed that bootstrap will be loaded for all the dashboard and I want to use it only to style my dashboard widget. My question is, will be possible to style using bootstrap only the widget, is there any hook or action that can be used?

Than you for the help.

1 Answer 1

0

You could load the dashboard widget into its own document in an iframe if the problem is bootstrap css messing up other parts of the page.

This answer has example code for the iframe widget part of it: Embed iframe or html page into dashboard widget

You just have to pass the iframe a url that doesn't have the entire site in it. Something as simple as a page with shortcode that uses a completely blank template would be easy to do if you control the whole site. If it's a plugin for general release, you might use a hardcoded page that loads the content with admin-ajax. More work, but cleaner, and could update on a timer, if that was a useful feature. I'd add some example code, but maybe I'll wait to see if that solution works for you, first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.