Skip to content

Further Widgets question

Solved Configure
4 2 833 1
  • Continuing my Widgets struggle here as although I asked about it on NodeBB forum, I still have remaining areas of confusion.
    I dont find the menu intuitive. In particular now Ive understood that the global .tpl will apply everywhere, are these Category / Topic settings irrelevant?
    20230526_163355~2.jpg

    Excuse the blurry photo, but what is the point of that
    Category 0
    Topic 0
    If its going to apply globally anyway?

  • Continuing my Widgets struggle here as although I asked about it on NodeBB forum, I still have remaining areas of confusion.
    I dont find the menu intuitive. In particular now Ive understood that the global .tpl will apply everywhere, are these Category / Topic settings irrelevant?
    20230526_163355~2.jpg

    Excuse the blurry photo, but what is the point of that
    Category 0
    Topic 0
    If its going to apply globally anyway?

    @Panda is there any reason not to include a screenshot rather than a photo of the screen? It’s a bit hard to decipher a blurry image 🙂

  • Apologies, was having technical difficulties with laptop with no PrtSrn button!
    widget.png

    Update
    There are tpl files for category and categories
    It seems this field works under category.tpl and not categories.tpl

    Im confused what the categories.tpl is for, but the category.tpl is working now, so problem solved

  • Pandaundefined Panda has marked this topic as solved on
  • Apologies, was having technical difficulties with laptop with no PrtSrn button!
    widget.png

    Update
    There are tpl files for category and categories
    It seems this field works under category.tpl and not categories.tpl

    Im confused what the categories.tpl is for, but the category.tpl is working now, so problem solved

    @Panda category is for a category in its own, so for example, “fruit” whereas categories is the page that contains all categories as a list.


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • 3 Votes
    1 Posts
    540 Views
    No one has replied
  • Opening links in nodebb widget

    Solved Configure nodebb
    6
    4 Votes
    6 Posts
    2k Views
    A more efficient way of including this would be to not over complicate it and leverage a standard iframe (providing the CSP headers of the remote site permit this) like below <iframe src="https://www.classmarker.com/online-test/start/?quiz=gag66aea7922f0a5" width="700" height="800"></iframe> This works first time every time on your site as intended.
  • Interesting Widget code, but can't fetch API

    Solved Customisation nodebb
    26
    2 Votes
    26 Posts
    6k Views
    @Panda said in Interesting Widget code, but can’t fetch API: How did you drop that widget into the post there? I hadnt seen this BSgenerator anywhere on sudonix site, do you use it somewhere already? Yes, here https://sudonix.org/topic/414/corporate-bullshit-generator?_=1687774393044 It’s not a “post” or “topic” in the common sense. It is actually a page in it’s own right and leverages nodebb-plugin-custom-pages. This in turn creates a new “route” which behaves like a page, meaning it is then exposed for widgets. @Panda said in Interesting Widget code, but can’t fetch API: Also can you explain more what you mean by calling the code externally. In my API call example, how would I go about doing that? By this, I mean create all the required code in an external JS file that is reachable by the NodeBB instance - so, in “public” for example - or in my case /public/js. The widget then “calls” that file and because it runs outside of the scope of NodeBB, you just need to return the values to the widget. Hope this makes sense?
  • Where are widgets stored?

    Solved Configure nodebb
    3
    1 Votes
    3 Posts
    850 Views
    @phenomlab Thanks, have DMed you
  • 4 Votes
    8 Posts
    1k Views
    @Panda said in Upgrade to NodeBB v3? 2BB or not 2BB, that is the question!: So although thats a plugin it has Widget like element and stopped working on the Theme change Which is normal based on the widgets being reset when you change themes.
  • Title on homepage of nodebb forum

    Solved Customisation nodebb
    2
    1 Votes
    2 Posts
    1k Views
    @eveh Welcome board The code you are referring to is custom written as no such functionality exists under NodeBB. However, adding the functionality is relatively trivial. Below are the required steps Navigate to /admin/appearance/customise#custom-header Add the below code to your header, and save once completed <ol id="mainbanner" class="breadcrumb"><li id="addtext">Your Title Goes Here</li></ol> Navigate to /admin/appearance/customise#custom-js and add the below code, then save $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { // Initialise mainbanner ID, but hide it from view $('#mainbanner').hide(); var pathname = window.location.pathname; if (pathname === "/") { $("#addtext").text("Your Title"); $('#mainbanner').show(); } else {} // If we want to add a title to a sub page, uncomment the below and adjust accordingly //if (pathname === "/yourpath") { //$("#addtext").text("Your Title"); //$('#mainbanner').show(); //} }); }); Navigate to /admin/appearance/customise#custom-css and add the below CSS block .breadcrumb { right: 0; margin-right: auto; text-align: center; background: #0086c4; color: #ffffff; width: 100vw; position: relative; margin-left: -50vw; left: 50%; top: 50px; position: fixed; z-index: 1020; } Note, that you will need to adjust your CSS code to suit your own site / requirements.
  • NodeBB slow after DB recovery

    Solved Performance performance nodebb
    1
    5 Votes
    1 Posts
    628 Views
    No one has replied
  • NodeBB - Created pages not found?

    General
    20
    3 Votes
    20 Posts
    4k Views
    @jac Exactly. Hard point to argue.