Closed rikcross closed 9 years ago
@CodeClubRik: Apologies – I’m not sure I understand. It sounds like you’re after more terms. Like this?
If so, that’s currently possible. If not, can you explain how your requirement differs?
That URL doesn’t work for me…
Hey @andylolz -- I mean additional entire sections, so we could have an 'additional projects' section underneath the current 'terms' section. I know that @Jonic set a version of this up, but additional sections can only be URLs and not manifests which build projects.
I mean additional entire sections, so we could have an 'additional projects' section underneath the current 'terms' section
Like this?
Sorry – I find it much easier to understand with an image :) So… Here I’ve put the additional projects literally underneath terms, rather than underneath in the menu hierarchy sense.
Yep, that kind of thing! :)
This is now done:
So, if you have something like this in the .manifest...
{
"description": false,
"id": "scratch_01",
"language": "en-GB",
"number": 1,
"title": "Scratch 1",
"category": "cat-legacy",
... and you had something like this for the cat-legacy
category in en-GB.languages...
{
"code": "en-GB",
"name": "English",
"registration_note": {},
"legal": {},
"translations": {
"cat-official": "Terms",
"cat-official.description" : "",
"cat-legacy" : "Additional Projects",
"cat-legacy.description" : "These are additional projects"
Then the title "Additional Projects" with the text "These are additional projects" will appear above this term, and every subsequent term rendered unless those subsequent terms change the category.
By default, all of this is optional and can be omitted, leaving the old behaviour intact.
Fixed in SHA: f505b4857636284aaf4cae11b3d2e93363ad902c Minor modifications to metadata in SHA: 0c791857804c902c82b8325e1521a218ed973495
Sample output (with totally made up metadata) can be seen here:
Nice!
One thing about using translations in this way… The fallback (when there’s no translation) becomes a key (e.g. “cat-official.description”) rather than the English text. This is only just worth mentioning, so I’m mentioning it :) The alternative would be to create a new sort of thing for categories (which would probably only result in more mess).
V nice though! I’ve commented on the commit directly with attempted answers to the questions in the comments.
Yeah...agreed. The use of translations is not ideal. My longer-term plan is to define the metadata for categories somewhere but this felt like the least-evil-while-getting-stuff-done way to give @CodeClubRik some more flexibility.
Defos. Makes a lot of sense :+1:
Currently I'm putting any project not in the 'core' curriculum into the 'Additional ... projects' sections, and these sections are getting quite big.
It would be great if we had the flexibility to create new sections, which effectively worked in the same way that the 'Terms' section does (i.e. building projects from manifests, etc.)
This means that I could create a second 'additional terms' section, to distinguish it from the core curriculum (or maybe even a section per language). We could also create a 'third-party resources' section, for stuff like the TWSU projects, which are currently static here: https://www.codeclub.org.uk/twsu.