Picture of Henrik Aabom
Creating Adapt menus - How to?
by Henrik Aabom - Tuesday, 16 August 2016, 12:57 PM
 

Hey everyone

I'm trying to create my own menu for Adapt and planning on making it work in the Authoring tool too. 

However I've encountered two roadblocks. Both of which are issues of me not understanding how menus work in Adapt. 

I know how the components work and how to create them, but menus work a bit different.

 

1) How do I tell the framework that I want to use my new menu? Is there a .schema file in which it tells the framework which menu to use?

What happens when I run "adapt install adapt-contrib-boxmenu"? Is it possible to do it manually instead?

 

2) The adapt-contrib-boxmenu has a "properties.schema"-file in which stuff like "durationLabel", "menuItem" and "menuEnd" are mentioned. Are these accessible in the Authoring tool? They are all nested inside 

"globals": { ... }

So I started to think that if I altered these it would be shown in the "Project Settings" in the authoring tool, but that doesn't seem to be the case. Unless I'm doing something wrong.

 

All in all, I'm trying to make it possible to put a <img> inside the menu, and through the authoring tool choose the src image to use in the menu. So that I can use different images for different projects, but by using the same menu.

Is this possible?

 

Any help here would be hot :)
Thanks in advance!

Henrik

 

Picture of Tom Taylor
Re: Creating Adapt menus - How to?
by Tom Taylor - Tuesday, 16 August 2016, 2:25 PM
 

Hi Henrik,

1)

By default, Adapt currently only supports 1 menu type per course. The reason for this being that any menu included in src/menu will render itself when the course wants to render a menu. Therefore, if you want a specific menu in your course, all you need do is to drop it into that folder.

2)

The properties.schema is the file that tells the authoring tool which attributes are editable, so you're indeed looking in the right place. However In the case of menus, there's currently no way to modify these settings in-tool (although this is something that is on our agenda).

What you can do however, is to set up some styles in the theme, and add them to the relevant section using the classes attribute. Due to the way that the tool only includes used assets, you'd also need to find some way to select/include the specific menu image you want. One way of doing this would be to write a custom extension which sets the image path (have a look at resources for something vaguely similar).