Custom pages break
-
I still don't get why should it happens...
-
so they should have called it
dist
...And inside it you should see only compiled sources.
.tpl
files are not compiled so they shouldn't be there.Also, I have placed a background image in that folder and it never been removed.
-
What exactly are you doing code-wise to set up the custom page?
-
@Fez-Vrasta said:
so they should have called it
dist
...And inside it you should see only compiled sources.
.tpl
files are not compiled so they shouldn't be there.Also, I have placed a background image in that folder and it never been removed.
It's not really compiled in the traditional sense, nodejs (JavaScript as a whole) is an interpreted language. What is stored in the public folder are templates that are assembled at startup depending on your theme choices, etc. so if you put some change in the tpl file it will get overwritten. The templates are then used by client-side parsers to render the content for the user.
If you're trying to make changes to something in a tpl file, you have to modify the theme directly.
-
@BDHarrington7 said:
@Fez-Vrasta said:
so they should have called it
dist
...And inside it you should see only compiled sources.
.tpl
files are not compiled so they shouldn't be there.Also, I have placed a background image in that folder and it never been removed.
It's not really compiled in the traditional sense, nodejs (JavaScript as a whole) is an interpreted language. What is stored in the public folder are templates that are assembled at startup depending on your theme choices, etc. so if you put some change in the tpl file it will get overwritten. The templates are then used by client-side parsers to render the content for the user.
If you're trying to make changes to something in a tpl file, you have to modify the theme directly.
I'm a JavaScript developer (I work with Ember.js and stuff like that) so I know how it works.
The problem is that if you want to use the public folder to provide only compiled stuff then the templates should be compiled as well (aka, JS files and not TPL files anymore)Something similar to what happens with handlebars: http://handlebarsjs.com/precompilation.html
@yariplus I just setup the custom menu item and then I use the custom pages plugin to show the custom page.
-
IIRC the templating system is hand-rolled, I'm not sure what decisions were made around that and why. @psychobunny is the one you would want to discuss the architecture of that system with.
-
@Fez-Vrasta Hey
It sounds like you may be misunderstanding what the custom-pages plugin does. (I assume that's the one you are using.)
You should not be creating a page for it route too. You are meant to add HTML widgets to the page on the Widgets panel. Then whenever you restart, it compiles that page for you.