Breadcrumbs in topics

Technical Support
  • Hi. I'd like to add breadcrumbs into each topic so that when each one is opened, the breadcrumbs appear at the top of the screen like they do in recent, categories, tags etc. I'm using the Persona theme, but cannot locate the template that needs to be modified.

    I thought it would be as simple as topic.tpl but this already has breadcrumbs listed, but they are not shown in the HTML being outputted.

    As an example, I'd like the breadcrumbs to appear just under the navbar below

    a0030aec-3a03-4347-9987-5957d132b4d6-image.png

    Any pointers ?

    Thanks

  • Found it. It seems that the customize plugin renders the overall template meaning that it looks like the breadcrumbs are being included when they are in fact not. If I edit topic.tpl directly, this works as intended 🙂

  • Here's the finished article

    50be1954-05e9-40d0-b785-e034fe813133-image.png file:///home/phenomlab/Pictures/Screenshot_20210429_113839.png

    All that was required was to include the breadcrumbs.tpl file, so

    aed1a8cd-c609-4261-932a-03d96aa631ef-image.png


Suggested Topics


  • 0 Votes
    1 Posts
    197 Views

    Hi all,

    I'm trying to use the recently introduced WriteAPI to create topics and concurrently upload a file.
    I'm doing it via Python and I've already succeeded in create a simple topic without a file using something lilke

    payload = { "cid": cid, "title": title, "content": message } headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=json.dumps(payload))

    but when it's about files using

    payload = { "cid": backstage_cid, "title": backstage_title, "content": backstage_message } headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'multipart/form-data' } verifySSL = False print (payload) if (useFile): with open(backstage_file, 'rb') as f: response = requests.request("POST", url, headers=headers, data=payload, verify=verifySSL, files={backstage_file: f})

    it returns
    Error: Required parameters were missing from this API call: cid, title, content cause passing the parameters in a plain dictionary rather than a JSON object seems not doable.

    The switch from JSON to dictionary is needed otherwise I wouldn't have been able to pass a file together with such header

    headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'multipart/form-data' }

    Has anybody valuable suggestions here?

    Thanks in advance, Riccardo

  • 0 Votes
    3 Posts
    422 Views

    @scottalanmiller is correct, those numbers are produced on the fly based on active websocket sessions, and not stored anywhere.

    However, you might be interested in https://github.com/barisusakli/nodebb-plugin-browsing-users, which brings a live-list of current users in-topic back to topic.tpl 😄

  • 0 Votes
    2 Posts
    281 Views

    It's not possible to do exactly what you say, but it is possible to accomplish a similar thing by creating a NodeBB plugin which implements the API endpoint you want, instead of using the built-in API.

  • topic template in nodebb

    Technical Support
    2
    0 Votes
    2 Posts
    597 Views

    Anyone please give little bit of clue. How a topic works in nodebb?

  • how to merge topics in admin ?

    Solved Technical Support
    29
    1 Votes
    29 Posts
    9k Views

    @baris said in how to merge topics in admin ?:

    Clicking on the topic title should work. Needs better UX though since other tools work by clicking the user avatar.

    yeap, it worked. Thanks. I was trying by clicking topic avatars as well.