Genie Discord forum

Author AvatarMordegai
7/13/2023, 10:20:48 AM

I would like to create an application where there is either a top or side menu that, when an item is selected, renders the rest of the page with the contents related to it. Is there an example of this somewhere? Thanks in advance!

Author AvatarPere
7/13/2023, 12:44:17 PM

We have an example of a page with multiple tabs. You'll probably need to edit the HTML manually though, tabs do not look very nice in Genie Builder yet

If what you want is multiple pages, that is not supported in Genie Builder yet. If you were to do it manually, here's how:

  • create a pagex.jl.html for each page
  • define a route to the page with @page("/pagexroute", "pagex.jl.html")

For the navigation bar, you could include it in the HTML of every page or use a layout. We don't have docs for layouts yet, but I'll show how to use them at the JuliaCon workshop.f

Author AvatarPere
7/13/2023, 12:44:58 PM

And if you're feeling adventurous, a more advanced way to have multiple pages is to keep a separate model per page (a model is what @app creates under the hood) like in this example

Author AvatarMordegai
7/13/2023, 1:22:25 PM

Thanks! I'll look into it and come back if I get stuck. So happy with your support!

Author AvatarMordegai
7/13/2023, 3:13:56 PM

I got it working! The only weird thing is that I see the overshoot.jl.html twice in the genie server view while the app clearly uses 2 different html pages, namely home.jl.html and overshoot.jl.html

Author AvatarMordegai
7/16/2023, 10:26:48 AM

The error is gone with the update but I still get double entries in the Genie apps panel. It's not causing any problems but I thought I'd mention it anyway.

Author AvatarMordegai
7/16/2023, 10:28:44 AM

There's one other thing. Everytime I edit a page with the nocode editor, the line "<% partial("nav.jl.html") %>" is transformed into "<% partial("nav.jl.html") %>". Is there a way to avoid this?

Author AvatarMordegai
7/16/2023, 11:23:04 AM

The duplicate issue seems to be related to the number of added pages. Well, there seems to be a correlation, not sure it it's the cause though.

Author AvatarDaniel Aguilar
7/17/2023, 11:26:37 AM

@Mordegai Thanks for reporting the issue. I've been trying to reproduce the issue without luck, though. Please could you provide a simplified example app where the issue is manifested so that I can reproduce and investigate? Thanks again!

Author AvatarDaniel Aguilar
7/17/2023, 2:09:17 PM

@Mordegai update on my message above: no need to send any example app, we were able to reproduce the issue and are now investigating. Will let you know when we make any progress. Thanks!