question of templating logic

Feature Requests

Suggested Topics


  • 0 Votes
    2 Posts
    72 Views

    I think the best solution is to just hide the checkboxes and only show them when you hover over the topic.
    Then it doesn't really matter where they are located, because they don't distract attention.

  • 0 Votes
    4 Posts
    2k Views

    @henrywright said:

    this idea wouldn't work if > 1 line change

    I was referring to my idea of making a manual 1-line change to the theme core at the point of each upgrade. That would avoid you having to use Git to merge in new commits each upgrade.

    Again, although not a clean way of working, it sounds like it'll be easier than what you're currently doing.

  • Consolidation of template languages

    Unsolved Feature Requests
    2 Votes
    5 Posts
    2k Views

    @psychobunny my template abstraction layer looks working for me 🙂
    Unfortunately the project in which I hoped to use NodeBB is wanished.
    But I'm still not lost my interest. PR was fired and waiting for review 🙂

    Maybe I'll make my own theme fully with Jade. Some day... 🙂

    As for supported template engines - there are modules for t.js templates and for Jade. I can add more engines if anyone needed.

    Main unresolved problems are:

    rendering of template block is supported only with t.js For other engines I only pass special variable that indicates what block is requested so it can be considered on template level calling helpers is quite complicated in t.js so you have to be carefull when using partials with another engine no generic cross-engine imports and partials

    I personaly don't think that these problems overweight benefits granted.

  • 0 Votes
    2 Posts
    1k Views

    I'm not too sure if we should be adding too much logic in the templates (gets super messy). That said, there is a way for you to accomplish the above, via helpers.

    JS:

    templates.registerHelper('iterateFn', function(data, iterator, total) { return (data.someVar && iterator === 3) ? true : false; });

    Templates:

    <!-- BEGIN someLoop --> {function.iterateFn} <!-- END someLoop -->

    Some real-world examples found here (none using the iterator variable as of yet though)

  • 0 Votes
    2 Posts
    2k Views

    @eva2000

    I believe we've discussed the possibility of having a HELP tab in the composer, but I can also see the usefulness of a FAQ thread or even a FAQ page.