Remedial Theming assistance
-
I'm at a loss.
I'm trying to do my first theme. I started with a clone of vanilla and I'm trying to alter the topic template. Nothing seems to take. On a lark, I copy the lavendar version into the same place. Still no change. Switch to laendar - I see what I should see. Switch back to mine and I see the normal Vanilla theme page.
I'm using nodebb dev starts as precaution...
In frustration I even stuck gibberish in a number of places just on chance something was looping odd. Kinda at a loss here.
My limited understanding of the theming here is "replace the file in your theme to override"
Can someone point out something obvious?
-
Just to be sure, are you restarting NodeBB after changing the active theme?
-
Greetings @Shard.
- Make sure you are using the Vanilla theme.
- Make sure you are editing from
/node_modules/nodebb-theme-vanilla/*
. - NOTE: DO NOT EDIT FROM:
/public/templates/*
. THIS IS THE COMPILED OUTPUT FROM THE ABOVE DIRECTORY!
You will need to use
./nodebb watch
. You will need to install supervisornpm install supervisor -g
Do not use
dev
for theming because its not really what its intended for in my opinion. You use watch to see changes live while the server restarts on every little thing you save. This is how I theme.When you are satisfied with the changes just run the server
./nodebb start
don't forget to do this. I usually take breaks and if my internet goes out I'm screwed because my site goes down lol. -
Maybe this will help:
Copying Vanilla Theme
@mootzville You are my hero. That did the trick! Hats off to you, Sir. Now on to actual theming!
NodeBB Community (community.nodebb.org)
The gist of it is just add "templates": "templates" to your themes theme.json file.
-
@mootzville Yeah, that's what I discovered.
https://docs.nodebb.org/en/latest/themes/create.html Seems to be a bit out of date.
templates: (Optional) A system path (relative to your plugin’s root directory) to the folder containing template files. If not specified, NodeBB will search for the “templates” directory, and then simply fall back to using vanilla’s template files.
Normal learning curve stuff for me, Bump into all the oddly/un/badly documented assumptions that make perfectly good sense when you've been working with it for a while.
-
I think as of latest (0.5.1) it does fall back. Likely the documentation has been updated ahead of time while this change hasn't shown up in latest stable