Foundation theme - M3.5

Foundation theme - M3.5

by Gareth J Barnard -
Number of replies: 15
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello,

Introduction:

In light of my post (and others) here: https://moodle.org/mod/forum/discuss.php?d=373899#p1511080, I have created a new theme called 'Foundation', but the theme is not abstract and works as a standalone theme.  It is an almost pure Bootstrap V4 only theme that is not a child theme of Boost, but rather only 'pulls' what it needs from Boost as a means of avoiding duplication.  There is no navigation drawer or docking:

Foundation theme screen shot.


Features:

  • Bootstrap V4 CSS with minimal additions for Moodle.
  • Child theme capable - in 'beta'.
  • Custom SCSS.
  • Custom Swatches from Bootswatch.com and licensed under the MIT License.
  • Partial template support.
  • Theme modules - in 'beta', see the swatch_modules.php file.

Where you can get it from:

I've just added it to the plugins DB, where it is awaiting approval and where I can work through some of the issues highlighted by the automated checks.  But in the mean time, you can get a 'beta' test server only version for Moodle 3.5 from: https://github.com/gjb2048/moodle-theme_foundation. ; Note: $CFG->themedir is not currently supported.


Motivation:

I want a theme that forms the 'foundation' for my themes with the newer Bootstrap(BS) V4 framework but without the 'Boost' baggage.  My other themes like Essential and Shoelace are based on BS 2.3.2 with LESS and V4 is SCSS.  The 'Bootstrapbase' theme is likely to be depreciated in M3.6 and removed in M3.7 to become a contributed theme.  Therefore I need a way forward with Essential and Shoelace with a parent theme that provides the same basic functionality as Bootstrapbase.

I also want to be progressive and provide features that core currently does not have but prove that they are worthwhile.  Such as:

  • Mustache template 'Partials' in a sub-folder.  Currently you can only have a 'partial' in the theme's 'templates' folder which looks messy.  Current drawback to this due to not being able to override certain core classes is that templates rendered at the server end can work this way, JS AJAX ones via a 'promise' with the AMD JS 'Templates' class.
  • Theme modules.  There has been talk in the past of being able to create 'modules' within a theme that add functionality to that theme and can then be transposed to other themes.  And as 'add-ons' so you can pick and choose the amount of functionality in your specific installation of the theme.  I've implemented something that works but may break the AMOS language mechanism - a fallback will work but will just mean more work installing the module.  The modules themselves add their settings dynamically to the theme and will only appear as an option / sub-page if they are there.  Currently one 'module' is provided in the theme called 'Swatch' where you can choose from a few of the 'MIT License'd Bootswatch.com themes.

Use and the future:

I must stress that the theme is 'beta' and in 'development', thus subject to change, such as possibly changing 'partial' to 'partials'.  I want to progressively improve and validate the concepts based upon feedback (please do say what you think here).  But I don't want to add functionality to the theme, I want to keep it simple so that it can be used both as a starting point and a maintainable parent theme for more complex child themes.


Cheers,

Gareth

Average of ratings: Useful (5)
In reply to Gareth J Barnard

Re: Foundation theme - M3.5

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Great stuff...I like it! Yes

It reminds me of my attempt at an early Bootstrap theme which I called  "Tiny Bootstrap".

Are there going to be any settings in your Foundation theme?

At the moment it appears to be taking on the bg-primary color which I set in Boost theme.

It's great I love it!

Thanks

Mary

Cheers


In reply to Mary Evans

Re: Foundation theme - M3.5

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks Mary,

There are settings already: Custom SCSS and Swatches.

G

In reply to Gareth J Barnard

Re: Foundation theme - M3.5

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Yes I know that...I changed Swatch to Superhero,,,which looks great.

I was thinking of other settings...mind you this is early days.

I was meaning are you contemplating adding more settings?

Thanks

M

Edited to correct some spellings...! 

In reply to Mary Evans

Re: Foundation theme - M3.5

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mary,

At the moment, no, I really intend to have the theme with the settings it has now.  Then leave for others to adapt it as they see fit.   Currently the setting menu is not appearing on the admin block unless you navigate to the appearance category or below.  Odd.

Cheers,

G

In reply to Gareth J Barnard

Re: Foundation theme - M3.5

by Jez H -

Modules is a great idea, we had been looking at moving things like sliders into blocks as adding block regions to a theme is very easy. What other kind of features were you thinking could be added as modules?

In reply to Gareth J Barnard

Re: Foundation theme - M3.5

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

P.S.  I think I need to clarify the word 'minimal'.  The theme does load the BS4 SCSS, all of the styles.css and all of the core 'moodle' SCSS but has a 'minimal' set of styles that it defines.  Therefore, probably as little as you can get away with.

In reply to Gareth J Barnard

Re: Foundation theme - M3.5

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Note: New download link is: https://github.com/gjb2048/moodle-theme_foundation - I'm starting to fix things from feedback smile. Please note that at any given time the theme can be 'broken' when pulling from the master branch. When I'm happy with a given state I'll tag it: https://github.com/gjb2048/moodle-theme_foundation/releases.

In reply to Gareth J Barnard

Re: Foundation theme - M3.5

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Version 3.5.0.4 is now available with fixes and Collapsed Topics support: https://github.com/gjb2048/moodle-theme_foundation/releases/tag/V3.5.0.4.

In reply to Gareth J Barnard

Re: Foundation theme - M3.5

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Version 3.5.0.5 is now available: https://github.com/gjb2048/moodle-theme_foundation/releases/tag/V3.5.0.5 - with collapsing block support.  Please do try it out on a test server and give me your honest opinion.  It is a 'basic' theme though smile.

In reply to Gareth J Barnard

Re: Foundation theme - M3.5,

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Gareth I am currently using a cloned copy of your GitHub Foundation theme. Is the latest update in a separate branch which I can checkout?

Cheers

Mart

In reply to Mary Evans

Re: Foundation theme - M3.5,

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mary,

Everything is in the master branch with the releases as tags.

G

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Foundation theme - M3.5,

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi...thanks got it.

Just a small hick-up there appears to be a missing string...'sitemenubar' in foundation/templates/partials/navbar.mustache

https://github.com/gjb2048/moodle-theme_foundation/blob/master/templates/partials/navbar.mustache#L34

Working late here but thought I would log this here befor loggin out.

Cheers

Mary

In reply to Mary Evans

Re: Foundation theme - M3.5,

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Mary,

Oh!  That is a core admin lang string that was added in MDL-62145!  I had not realised it was not in core Moodle before.  You need to have version 2018051702.11 3.5.2+ (Build: 20181027) in order to get it!

I'll need to think about this!

G

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Foundation theme - M3.5,

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

OK...thanks for the heads up. I'll do an update of MOODLE_35_STABLE & master on my Test Server and get back to you if there is a problem still!

Cheers

M