thexerteproject / xerteonlinetoolkits

Xerte Online Toolkits
www.xerte.org.uk
Apache License 2.0
62 stars 61 forks source link

Provide for pre-populated templates and learning designs #765

Closed ronm123 closed 2 years ago

ronm123 commented 6 years ago

Just adding my recollection of what we discussed re adding this functionality...

Option should appear when creating a new project to select from a list of pre-populated templates for that project template The pre-populated template should include all pages, media and settings including themes and logos etc It should be possible to manage these via the management area including adding, removing, replacing/updating The same functionality should exist for each different project template

torinfo commented 6 years ago

The principle now works, but there is no user interface (in management.php) yet, and also at this point in time no provision to enable/disable pages (iether manual or automatic)

So,

  1. run upgrade.php, this adds a parent_template column to originaltemplatesdetails and sets that to the same name as the template for now
  2. As a test I included a FutureTeacher template
  3. To test, add a new template to the originaltemplatesdetails table like this: '18', 'xerte', 'FutureTeacher', 'Nottingham', 'A flexible template for creating interactive learning objects.', '2018-06-09', 'Future Teacher', '0', '*', '1'
ronm123 commented 6 years ago

@torinfo just gave this a quick test and it mostly worked but at least one issue...

Ran upgrade ok Manually created the template ok Can see that the template contains two pr-added and pre-populated pages and the theme selected is Future Teacher

However when playing the LO the default theme is used and changing the theme e.g to Flat Blue doesn't have any effect. It's because it's looking for /themes/FutureTeacher/flatblue/flatblue.css rather than themes/Nottingham/flatblue/flatblue.css Should the template_name in the database be Nottingham rather than FutureTeacher?

torinfo commented 6 years ago

@ronm123

No, but apparently I need to fix retrieving the theme in xenith. (and the other runtimes).

ronm123 commented 6 years ago

@torinfo I've tested this a bit more since you fixed the theme issue and it works great! I can see this being really popular even before we have a management interface etc. You'll have seen that I committed a tiny change to the wording and changed and to then to indicate a 2 step process a bit more clearly. However on all of that and the way the front end might read and need to work I can see there being quite a few "derivative templates" and pre-populated learning designs of different types added to installations over time so I think it will be important to display the description as well as just the name and possibly a link to a preview too. So I was thinking how that might look and work and we obviously all need to share our thoughts on that. Also I don't know if you've ever used the existing example functionality but I was thinking that needs to be available for the derivatives too. So here's a quick mock-up for discussion. I cheated and used a different tool! ;-) https://mitchellmedia.co.uk/demos/xerte_derivatives/

@FayCross @juliantenney What do you think? How many derivatives could you se being part of the UoN install and how best to display those options?

FayCross commented 6 years ago

I've just updated my xampp install with the current develop code, have run upgrade.php but am having issues creating new projects. I'm guessing it's something to do with these changes? After I enter a project name & click create I get this error in the console: Uncaught TypeError: Cannot read property 'length' of undefined validation.js line 70

Does anyone else have this issue?

torinfo commented 6 years ago

@FayCross No, I am not seeing that. The location of the error suggests that the name you filled in does not end up correcly in the code. Caching?

FayCross commented 6 years ago

No, I've cleared it. Maybe I missed some files with I upgraded. I'll check

FayCross commented 6 years ago

Yep, it was my fault - working now!

torinfo commented 6 years ago

Perfect :-)

FayCross commented 6 years ago

I've just setup a new install of xerte on xampp on a new laptop using today's develop code (I have all the files this time!). No errors during setup but the project templates section of the workspace is blank so I can't create any projects. All the templates seem to be turned on when I look at them in the management pages.

Everything worked fine when I upgraded an existing xampp install earlier so is there something in your new commits that new installs would struggle with @torinfo?

torinfo commented 6 years ago

@FayCross Ehmm yes. I realise I forgot to include the proper column (that is added using the upgradde.php) in the basic sql setup. Will add that a.s.a.p.

FayCross commented 6 years ago

Thanks @torinfo