Custom pages break
-
I don't get what you mean by "every day"? Also what version of nodebb / plugin version?
-
With "every day" I mean that every X hours it breaks (probably after reloads, restarts, new plugins etc).
I have created an empty .tpl using touch
-
@Fez-Vrasta said:
With "every day" I mean that every X hours it breaks (probably after reloads, restarts, new plugins etc).
I have created an empty .tpl using touch
just noticed it comes back after a while, sounds like clashing with something else
EDIT: just disable in ACP -> GENERAL -> Navigation block.
Enable it again later.. test it after a while. comes back, then enable it again in NAvigation again.
strange
-
@Fez-Vrasta said:
With "every day" I mean that every X hours it breaks (probably after reloads, restarts, new plugins etc).
I have created an empty .tpl using touch
well, If you are creating a .tpl file in "public" folder it'll be deleted after some time. Use your theme folder instead.
-
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.