I am working on a project in Wappler beta 5 on nodejs and when I create a new project is creates a index.ejs file and puts it in the Pages /views folder. Considering it creates the index as .ejs, when creating a new page I assume I should be creating an .ejs page, but when I go to save it wants to add it to the /public folder, so what is it: views or public?
Also when creating a .ejs file it appears that the layout does not respond as expected, it appears to ignore css. I have no idea what is going on here and no idea if this is the node.js beta version is so buggy that I am better of just working with html pages and if so where am I supposed to put them assuming that one day node.js will work.
I donât want to waste my time building in php (not ideal) only to have to rebuild the whole lot in nodejs later.
Perhaps I am just better working on html pages and worry about the .ejs until the issues have been ironed out?
In NodeJS all dynamic pages that require server side rendering or includes will be pages with extension ejs
Static pages that donât have any dynamic data will be just plain HTML and saved in the public folder.
The Pages Manager in Wappler takes care of all this for you. That is why it has a dynamic / static switch so you donât have to bother with file extensions and locations.
Just use the Page Manager to create and manage your pages.
I have the same issue - all the pages created using Node.js on a Docker machine (on local machine) ignores CSS. The pages are correctly in âviewsâ and loads - just does not look right. Any idea why this might be? I am beginning to think it might be a Wappler bugâŚ
It sounds like you have created a âcontentâ page but not assigned a âlayoutâ page.
Node content pages require a complimentary layout page to add all the css, script files and extensions. Choosing ânoneâ for the layout doesnât give you a usable page.
@george,
This is possibly the most common confusion appearing in the forum at the moment. Why not add a blank layout in projects that the none option points to? It would solve a lot of questions.
As I already explained this to you in another topic: you cannot load the content page directly in the browser.
It should be loaded Inside the layout page in the browser.
Teodor, clearly I havenât got it - and please consider the outside possibility that you are not understanding me either!
I am NOT trying to load a content page in the browser.
Here is my issue, again:
I created a .ejs page called test.ejs, and assigned it a layout page, which has a content page on it. the test.ejs previews correctly in Wappler, but not in the browser.
Your test content page should be loaded in its layout page in your browser.
It doesn't matter if you assigned a layout page to the content page. It cannot be loaded in the browser directly!
So, the âpreview in browserâ button on Wappler should not be used while working on a dynamic page while using Node.js? Thatâs all I am trying to do. I have a page in design mode, I want to view that in the browser. Please can you list the steps to do that?
But this is not a content page I am talking about. I click the + button whilst in Dynamic tab. I edit that page and add elements to it. How can I preview that page in browser?