Having an issue with main layout and index content page in NodeJs project

Hi, i have just started to experiment nodejs project in wappler 3.0.0.
i got issue on main layout and index content page, main layout has navbar. when i created the index content page using main layout and deploy to docker and tested in browser. navbar is not showing. only content page content is shown. please look at the screenshots. please help. i did looked at docs for creating the layout and content page, I’m missing something? i have no idea…

Well the preview of the content page in Wappler does not render your layout page content. It just shows the content of the content page itself.

When you load your content page in a browser you will also see the template/layout content.

I did not understand exactly what you pointing out Teodor. but this is i got in the browser

Are you sure you created this page from your main layout and are you sure you deployed everything to your target?

above screenshot shows i have created the index.ejs using layout as main.

could you please tell me how do i make sure my target has all the files and folders?

This is the layout page:

This is one of the pages:

And this is what shows in the browser:

2 Likes

Hi Ben, Are you using windows version of wappler 3.0? i’m using mac version…

i have created the main page as layout and added navigation bar. and then i have created index page using layout as main. but i don’t get the same result as you do.

My mac version is macOs Catalina 10.15.5

There is no difference between the Windows and MacOS version of the UI and workings.

Yes George, i do know that. but i truly telling you in my mac i experienced so many wired differences than others. some time when i update a paragraph with real text then its reset back to default one, thats an example. right now i have attached the screenshot (above), could you tell me what wrong i’m doing on that?? maybe i’m blind…

This is where you have gone wrong, the page should not be in Partials but in Pages (/Views). See my screen captures.

@thines if you follow the docs step by step there will be no issues.
As Ben just pointed there are some weird stuff going on on your screenshots.

I suggest you to start freshly from scratch and make sure you follow exactly what’s shown there. If there were issues on Mac you wouldn’t be the only one experiencing them. Half of our users are using Macs.

this is wrong Ben, its not inside the paritals folder, as you can see the index.ejs file is in folder level. I did followed the documentation and created this just a simple main layout page and index page as content page inside views folder

i have done three times like this, :slight_smile: same result for me…thats really strange.

Can you paste the contents of routes.json?

{
  "routes": [
    {
      "path": "/",
      "page": "index",
      "routeType": "page"
    }
  ]
}

Say no more. That route is not loading your layout. I don’t know how it was generated but it’s wrong.

Yes your index is a regular page and not a layout based page.

route is auto created right? i did not touched it, let me do once again from scratch and get back to you

As i said i have tried few time recreating from scratch, every time i get different result… :frowning:

here is my route.json content:

{
“routes”: [
{
“path”: “/”,
“page”: “index”,
“routeType”: “page”
},
{
“path”: “/”,
“page”: “index”,
“layout”: “main_template”
}
]
}

if anyone available to help me remotely now…with teamviewer, would be helpfull.

i have no clue what im missing.

also have a look at red circled one, half green, i saw full green in Ben’s screenshot.

well now you have two routes to your index page … and the old one comes first
go to the routes panel and remove the one without the layout page