Remedial Theming assistance

General Discussion
  • 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?

  • Yeah, I'm doing a full on stop and nodebb dev.

    I just tried replacing the topic.tpl with a file containing an H1 one liner and I'm still getting the vanilla output.

    boggle

  • Meanwhile, I make the same changes I was making to the Lavender theme and it works as desired.

    Gah.

  • 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 supervisor npm 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.

  • I sorted out the issue. The problem appears to be the lack of a "themes" key in my themes.json.

    Still other issues, but that seems to have been the big one.

  • @Shard said:

    I sorted out the issue. The problem appears to be the lack of a "themes" key in my themes.json.

    Still other issues, but that seems to have been the big one.

    Such as now none of the styling works...

  • Pebkac, as expected. 🙂

    All sorted.

    I am a little puzzled about the need for the templates entry. the docs I saw say it is assumed and then falls back to vanilla, but that doesn't seem to be what actually happened....

  • @Shard

    Maybe this will help:

    https://community.nodebb.org/topic/2382/copying-vanilla-theme/11

    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

  • I'm using 0.5.1, FWIW.


Suggested Topics


  • 0 Votes
    3 Posts
    432 Views

    @jtsimoes Thanks for mention.

    @Matic81 Write to me pv.

  • 1 Votes
    2 Posts
    879 Views

    What is your budget?

  • 0 Votes
    1 Posts
    815 Views

    I work on nodebb 1.5.3 and accidentally made the grave mistake of installing a plugin using ACP and ended up losing all my development repos of non 'npm'ed plugins. At that point I decided to upgrade to latest 1.7.3 release since a fix (#6032) for this issue was supposed to be committed into that build. While I checked breaking change lists for 1.6.0 and 1.7.0, apparently I have over looked something since my list/grid topic-list show up all messed up (with no errors in console). I have a bootstrap based listview and gridview of the topics and I use JS code to select between them but now my page layout is gone like one of the libraries is not loading but I am not sure which one since I don't use anything other than jquery and bootstrap.I cannot figure this out but suspect it may be issue (#5980.) Any help would be appreciated and thank you in advance.

    Edit:

    I get the following error intermittently after several clicks and I am hoping to be related:

    Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\category.js:
    Error: Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\category.js:
    Script execution timed out.
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at ContextifyScript.Script.runInNewContext (vm.js:59:15)
    at Object.runInNewContext (vm.js:112:38)
    at evaluate (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\evaluate.js:17:6)
    at fs.readFile (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\express.js:39:53)
    at D:\NodeBB-1.7.3\node_modules\graceful-fs\graceful-fs.js:78:16
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)
    Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\500.js:
    Error: Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\500.js:
    Script execution timed out.
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at ContextifyScript.Script.runInNewContext (vm.js:59:15)
    at Object.runInNewContext (vm.js:112:38)
    at evaluate (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\evaluate.js:17:6)
    at fs.readFile (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\express.js:39:53)
    at D:\NodeBB-1.7.3\node_modules\graceful-fs\graceful-fs.js:78:16
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)
    2017-12-31T06:55:43.950Z [1840] - error: /category/14/news
    Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\category.js:
    Error: Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\category.js:
    Script execution timed out.
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at ContextifyScript.Script.runInNewContext (vm.js:59:15)
    at Object.runInNewContext (vm.js:112:38)
    at evaluate (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\evaluate.js:17:6)
    at fs.readFile (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\express.js:39:53)
    at D:\NodeBB-1.7.3\node_modules\graceful-fs\graceful-fs.js:78:16
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)
    Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\500.js:
    Error: Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\500.js:
    Script execution timed out.
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at ContextifyScript.Script.runInNewContext (vm.js:59:15)
    at Object.runInNewContext (vm.js:112:38)
    at evaluate (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\evaluate.js:17:6)
    at fs.readFile (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\express.js:39:53)
    at D:\NodeBB-1.7.3\node_modules\graceful-fs\graceful-fs.js:78:16
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)
    2017-12-31T06:55:49.005Z [1840] - error: /category/14/news
    Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\category.js:
    Error: Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\category.js:
    Script execution timed out.
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at ContextifyScript.Script.runInNewContext (vm.js:59:15)
    at Object.runInNewContext (vm.js:112:38)
    at evaluate (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\evaluate.js:17:6)
    at fs.readFile (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\express.js:39:53)
    at D:\NodeBB-1.7.3\node_modules\graceful-fs\graceful-fs.js:78:16
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)
    Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\500.js:
    Error: Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\500.js:
    Script execution timed out.
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at ContextifyScript.Script.runInNewContext (vm.js:59:15)
    at Object.runInNewContext (vm.js:112:38)
    at evaluate (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\evaluate.js:17:6)
    at fs.readFile (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\express.js:39:53)
    at D:\NodeBB-1.7.3\node_modules\graceful-fs\graceful-fs.js:78:16
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)

    ...
    some more errors I get after refreshes:

    2017-12-31T07:42:50.130Z [13716] - error: /category/5/general
    Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\category.js:
    Error: Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\category.js:
    Script execution timed out.
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at ContextifyScript.Script.runInNewContext (vm.js:59:15)
    at Object.runInNewContext (vm.js:112:38)
    at evaluate (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\evaluate.js:17:6)
    at fs.readFile (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\express.js:39:53)
    at D:\NodeBB-1.7.3\node_modules\graceful-fs\graceful-fs.js:78:16
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)
    Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\500.js:
    Error: Parsing failed for template D:\NodeBB-1.7.3\build\public\templates\500.js:
    Script execution timed out.
    at ContextifyScript.Script.runInContext (vm.js:53:29)
    at ContextifyScript.Script.runInNewContext (vm.js:59:15)
    at Object.runInNewContext (vm.js:112:38)
    at evaluate (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\evaluate.js:17:6)
    at fs.readFile (D:\NodeBB-1.7.3\node_modules\benchpressjs\build\lib\express.js:39:53)
    at D:\NodeBB-1.7.3\node_modules\graceful-fs\graceful-fs.js:78:16
    at tryToString (fs.js:513:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:501:12)

  • NodeBB Theme

    Solved General Discussion
    0 Votes
    4 Posts
    1k Views

    Oh, thanks a ton.

  • My next theme

    Moved General Discussion
    0 Votes
    34 Posts
    12k Views

    I agree with @psychobunny on the stripes.. Maybe use the same color as the header bar background for continuity.