Picture of Ross Murray
Advice on Upgrading theme to new version (Adapt Authoring Tool, V5 framework)
by Ross Murray - Wednesday, 24 November 2021, 8:54 AM
 

Hi,

I'm developing my first theme for Adapt 5 and getting familiar with the changes from Adapt4. 

I'm having difficulty seeing changes to my themes default colours (modifying the _colours.less) file. I've realised this is because every time I change a colour, I also need to change its default value in project.schema for the authoring tool.

This would be fine if I could do the 'Force rebuild' and although this works for somethings, it doesn't respect changes to the project.schema file. I've noticed I need to reupload the theme fresh each time.

Is there a way to upload the theme as a new version? I've only managed to get it to work by deleting and replacing the theme. I thought I could just update the version number in the bower.js file but I get an error when I try to upload that way. Am I missing something?

Thanks

Ross

Picture of Jason Wilson
Re: Advice on Upgrading theme to new version (Adapt Authoring Tool, V5 framework)
by Jason Wilson - Wednesday, 24 November 2021, 10:41 PM
 

Hi Ross, just to confirm - you are creating your custom theme in the correct location? For example, the path to my custom theme is as follows:

adapt_authoring\temp\6126bbe2f9a87d5b005aea93\adapt_framework\src\theme\custom-theme

You should be able to create a custom LESS file in the following folder: custom-theme\less\project

I just called mine "custom.less", but you could also add your custom styles to the "theme-extra.less" file.

I add all my custom stylings or overrides in this custom.less file - the file should automatically get detected, and update your course when you Force Rebuild.

If you want to change the page templates, just copy them from the original folder: adapt_authoring\temp\6126bbe2f9a87d5b005aea93\adapt_framework\src\core\templates

And add them to this folder: adapt_authoring\temp\6126bbe2f9a87d5b005aea93\adapt_framework\src\theme\custom-theme\templates

I've never had to touch the project.schema file in relation to theme customisation, but I should also add my theme is based on the Vanillla theme.

You may also want to check the order that your styles are built when using Force Rebuild - perhaps your updates are being added to the minimised CSS file before the default styles (which would then override your custom styles)?

You could also check your styles etc by ticking "Generate sourcemaps" from the course "Configuration" section. This allows you to use the dev tools in your browser to see where your styles are coming from.

Hopefully, some of this may be of help!

Picture of Ross Murray
Re: Advice on Upgrading theme to new version (Adapt Authoring Tool, V5 framework)
by Ross Murray - Thursday, 25 November 2021, 9:07 AM
 

Hi Jason,

Thanks for the reply!

Yeah I've created my custom theme in the adapt_authoring\temp\6126bbe2f9a87d5b005aea93\adapt_framework\src\theme\ folder and it's based on the latest Vanilla theme :)

The main issue I've come across is that I've been updating the colour definitions in less/defaults/_colors.less which works for certain things, but a few of them are also set in the properties.schema file. So when I preview/ rebuild my course from the authoring tool, I'm not seeing the colour changes.

I was hoping that the force rebuild would take into account the project.schema but it doesn't appear too. Only way I can get the project.schema settings to update is by doing a fresh upload of the theme. I was hoping that I could simply upload the theme as a new version by changing the version number in bower.json, 

i.e. 

 "version": "1.1.0", but that results in an upload error. Only way I've gotten it to work is by deleting my theme and reuploading it.
 
I'm thinking another solution might be to null all the colours set in project.schema so that the colours in _colours.less take precedence.. might be the quickest solution..