brad
May 3, 2022, 3:41pm
1
Okay, I'm stuck.
A single page application (SPA) is a web site/app that re-renders its content in response to navigation actions like clicking a link, without reloading the whole page. It consists of main template and different views, which are rendered in the main template.
SPA for NodeJS
It’s possible to build SPA pages and enable partial refresh thanks to NodeJS templating system.
In our example we will show you a simple SPA page, containing of a main layout with navbar and two views, which will be loaded …
When creating a website usually you want to include common elements like header/menu and a footer on all you pages. This was possible until now using SSI (server side includes) but this technique requires you to add your SSI on every page you create.
With the new template based pages you can setup a main layout, which includes all your common elements and use it to create your site pages. This way you don’t have to include SSI on all the pages you create, as they will just use what’s included…
Here is what I have ....
My layout (main) and index works just fine. But how do I add another content page?
Hi Brad, it’s quite easy:
Right click Layouts and add new page in order to create a new layout/main page:
Right click Pages/Views and add new page in order to create a new content page4:
And the documentation you linked to is quite up to date Not sure what you mean it’s outdated / useless …
brad
May 3, 2022, 3:56pm
3
No screenshots or steps match what I have. (See my screenshot) Even the ones you posted just now don’t match.
When I create a new page for a content page it adds all the head tags and everything, not the Wappler comment code like on the index.ejs page. So how do you make it a content page?
Brad you need to switch to PAGES manager / view, so the screenshots match what you have …
brad
May 3, 2022, 4:03pm
5
Well, how about that. Didn’t even know there was a pages manager. That needs to be made more clear in the docs for us dummies.
Now it makes more sense! And I take back my comment about the documentation.
Thank you once again, now I can continue on in my learning node journey.
You can also use the Add New page button in the top toolbar to add new pages:
And select the page type there:
brad
May 3, 2022, 4:07pm
7
Yeah, it’s easy as pie once you know all the details. It is in fact pretty simple and straightforward. Well done, Wappler team.
I just didn’t have that one detail of the page manager. Thank you again. Much appreciated.
Haha, i remember you were quite against it when we introduced it back then in Wappler 3
What is the purpose of having this view. I find this view pretty much useless. Perhaps if it showed thumbnails of the page or something. File view is much more productive to find files.
Also, everytime I open Wappler it defaults to the Pages view and I have to switch it. Please don’t force me to use that Pages view.
brad
May 3, 2022, 4:13pm
9
lol, well, I still much prefer the ‘Files’ panel. But in Node it looks like we have no choice. I would probably just use the ‘Pages’ when creating a new page then switch back. But, overall, I don’t hate it as much as I did on first impression.
How the heck did you dig up that dirt on me so fast? Haha …
I just remember you were one of the people not liking it much No hard feelings!
BTW, with node you don't really need the files panel, it's easier to work in the Pages view in my opinion.