Hello there,

I am using Outsystems 10 (I know - I'm anxiously waiting for my client to transition to 11), version 10.0.1018.0.

I'm creating a custom Template in Web, and I am having troubles creating the Menu.

At first, I tried making my own Weblock, but I kept getting the warning that the block was not a valid Menu. The documentation doesn't help:

If you want to keep the same functionality in your themes, create a menu web block with the required input parameters and the entities. Refer to the existing themes for input parameters and entities.

Not sure why the exact requirements aren't stated in the documentation. Anyway, eventually I just copy + pasted a Menu Weblock from an existing template and added the Entities which appeared to be in use in the menu. The warning vanished, so I assumed the menu would now be functional. Yet all was not well.

Now, if I drag and drop a screen into the menu in a module using an existing template, I get a nice scaffolding which generates a menu item with the DropDownMenu RichWidgets and the conditional style class: 

But if I try to do the same in a module using my custom template, I just get a link.

How can I get the same behaviour in my own template? Both modules have the DropDownMenu widgets, the same Menu Weblock, and the (empty) MenuItem and SubMenuItem entities.

I don't know how my client feels about posting omls online, so hopefully the snapshots will suffice. Any help would be appreciated!

This issue seems to be like you have't follow the correct documentation of creating a custom layout.

please follow this document 

https://success.outsystems.com/Documentation/SILK_UI_Framework/04_Understanding_the_Screen_Layout#Silk_UI_Web

also i just wanted to let you know, the scaffold have some limitation if you have  default  layout placeholder declared then only it will work eg. menu, title breadcrumbs etc.


Regards,

Pankaj

Pankaj pant wrote:

This issue seems to be like you have't follow the correct documentation of creating a custom layout.

please follow this document 

https://success.outsystems.com/Documentation/SILK_UI_Framework/04_Understanding_the_Screen_Layout#Silk_UI_Web

also i just wanted to let you know, the scaffold have some limitation if you have  default  layout placeholder declared then only it will work eg. menu, title breadcrumbs etc.


Regards,

Pankaj

Completely Agree with Pankaj. Also in case of issues with scaffold, you always have the option to implement things yourself. This will provide deeper understanding on how OutSystems works.


Regards,

Saugat


Dear Saugat and Pankaj,


Thank you very much for your swift replies. The page you linked to states the following:

  • The container with the class "Page" and extended attribute “GetCssGlobalContext()” is mandatory.

  • The Block WidgetsForLayout inside the layout is mandatory.

  • All page elements need a Class return by the CssGetContext Function.

Now the last line thoroughly confused me. 

  • Is the CssGetContext Function a misspelling of the GetCssGlobalContext() function they mentioned earlier? 
  • By 'All page elements', do they mean every single element in the Widget tree or simply all elements with the Page class?
  • By 'a Class return' do they mean 'a Class returned', or something else altogether?


I implemented the other instructions, and that did not resolve the issue. Two thoughts: 

  • The Menu Weblock is a completely separate Weblock from the layout. Surely the functionality of the scaffolding in the Menu is unrelated to the structure of my Layout Weblock?
  • I took a look at a clone of the Layout_London Weblock from RichWidgets, and that layout does not conform to any of the instructions from the documentation. There is no Page container with the global context call nor a WidgetsForLayout block. Yet the menu worked fine when using this Weblock. Wouldn't that imply the problem lies elsewhere?


And yes, it is possible to make the menu items manually. I did so in my own application. However, this Template will be used by many developers, and I want to offer them the same convenience that other templates offer. Therefore, I'd really like to get the scaffolding working. Any ideas? 

Thanks again!

Joris

Solution

SOLVED.

Okay, it was something different altogether. The module default theme was set to the general theme instead of the application's theme... which contains the layout and the menu. After I set it to the application's theme, the scaffolding worked again. So apparently, if your application's default theme does not point to the menu, the scaffolding doesn't work. Interesting.

Thanks for your help, guys! Out of curiosity, any thoughts on the comments I made on the documentation? Reckon the article should be improved, or did I misread it?


Solution