Theme without boostrap

melbournevijay
Posts: 1
Joined: Tue Jan 14, 2020 6:16 am

Theme without boostrap

Post by melbournevijay »

WonderCMS is awesome and easy to use.

I was able to follow the 8 easy steps to create a theme.

However, I noticed that the settings dialog is completely broken in the absence of bootstrap css and js.

I like to keep my sites lightweight.

Do you have a theme without bootstrap? OR Is it possible to only load jquery and bootstrap css and js when logged in?

Many thanks, Vj

User avatar
StephanStanisic
Developer
Posts: 37
Joined: Fri Jul 05, 2019 8:51 pm

Re: Theme without boostrap

Post by StephanStanisic »

Hey melbournevijay,

Welcome to the WonderCMS community!

Awesome question, this is a problem I've found before. I made a skeleton for a bootstrap-less theme on github:

For normal themes:
https://github.com/StephanStanisic/_empty

For single page themes:
https://github.com/StephanStanisic/_single

These themes include bootstrap just on summernote, summernote-air and the admin panel.

Let me know if this helps!

(These skeletons are really a WIP, any modifications/pull requests are happily welcome!)

User avatar
wiz
Admin
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Theme without boostrap

Post by wiz »

Stephan you ROCK!

Would it make sense to implement something like a check mark in the "Settings" panel that would disable Bootstrap and jQuery for visitors? Possibly two, for disabling Bootstrap and/or jQuery separately?

User avatar
StephanStanisic
Developer
Posts: 37
Joined: Fri Jul 05, 2019 8:51 pm

Re: Theme without boostrap

Post by StephanStanisic »

Sorry for the late reply, didn't saw the reaction.

I think it would be better to remote the frameworks all together, and let the theme include them if they use them. The usage of javascript is minimal right now and I don't see the added benefit of keeping an old version of bootstrap inside WonderCMS.

Of course I am currently testing the possibilities of this, including the new admin panel I mentioned and (hopefully, didn't start yet) a way for plugins to create custom admin menu options.

Also, if you would like to go the check mark route you should add this as a configurable option inside the theme. Problem is if a plugin requires bootstrap (summernote) and a theme doesn't have the bootstrap enabled it will not work. By getting rid of bootstrap all together this isn't a problem any more.

User avatar
wiz
Admin
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Theme without boostrap

Post by wiz »

With the latest WonderCMS 3.0.5, Bootstrap and jQuery can be removed from the theme, but the Bootstrap and jQuery will be still included for the admin.
This feature enables any developer to remove the user facing libraries while maintaining a functional WonderCMS admin.

I believe this is the wanted behaviour?

User avatar
mjxl
Posts: 44
Joined: Thu Jan 30, 2020 4:57 am

Re: Theme without boostrap

Post by mjxl »

Just chipping in, I saw the cdn admin javascript file is just a couple of functions, which are easily replaced by todays vanilla JS 8-)

I'm assuming there are a couple more JS calls in the index.php ? I've not inspected index too much :)

User avatar
wiz
Admin
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Theme without boostrap

Post by wiz »

mjxl, we're planning on migrating away from jQuery for the admin panel, as well as bootstrap.
So on the admin part, there should be no more external libraries.

Hope this is good news for you ;)

User avatar
mjxl
Posts: 44
Joined: Thu Jan 30, 2020 4:57 am

Re: Theme without boostrap

Post by mjxl »

wiz wrote:
Thu Apr 23, 2020 12:45 pm
mjxl, we're planning on migrating away from jQuery for the admin panel, as well as bootstrap.
So on the admin part, there should be no more external libraries.

Hope this is good news for you ;)
Neat! I really don't mind it being there, but looked like it could go without jQuery anyways :p!

User avatar
wiz
Admin
Posts: 749
Joined: Sat Oct 30, 2010 12:23 am

Re: Theme without boostrap

Post by wiz »

Good news, first part of the detaching WonderCMS completely from the bootstrap library is done, along with a lot of other improvements such as easier editing, animations, UX improvements.

Something like having "backups" for pages would be also awesome, but I think we still need to figure that out.
Next part is detaching jQuery and then we're ready for a release.

User avatar
mjxl
Posts: 44
Joined: Thu Jan 30, 2020 4:57 am

Re: Theme without boostrap

Post by mjxl »

wiz wrote:
Mon Apr 27, 2020 2:52 pm
Good news, first part of the detaching WonderCMS completely from the bootstrap library is done, along with a lot of other improvements such as easier editing, animations, UX improvements.

Something like having "backups" for pages would be also awesome, but I think we still need to figure that out.
Next part is detaching jQuery and then we're ready for a release.
Awesome, when I tried removing the need of jQuery, I only got stuck on the $get/post thingy.
This could be replaced with Fetch/XHR, right?

The rest of it was pretty straightforward, as they are just regular functions :3

Post Reply