• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

What's the hook for filtering posts in a topic page?

Scheduled Pinned Locked Moved NodeBB Development
5 Posts 2 Posters 1.9k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • pichaliteP Offline
    pichaliteP Offline
    pichalite Plugin & Theme Dev
    wrote on last edited by
    #1

    What's the hook for filtering posts in a topic page?

    @julian @baris

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by julian
    #2

    filter:topic.build 😄 (that's a link btw)

    pichaliteP 1 Reply Last reply
    0
  • pichaliteP Offline
    pichaliteP Offline
    pichalite Plugin & Theme Dev
    replied to julian on last edited by
    #3

    @julian showing off your markdown skills? 😄

    Can I use this hook filter:controllers.topic.get instead of filter:topic.build so I can filter the topics before all the additional processing happens?

    If I can use filter:controllers.topic.get, can you add the logged in users uid to the data passed in to the hook?

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #4

    @pichalite said:

    If I can use filter:controllers.topic.get, can you add the logged in users uid to the data passed in to the hook?

    Feel free to submit a PR for this. Instead of passing in topicData, pass it in an object.

    It's a breaking change, so, in for a penny, in for a pound, look for all other filter:controller... type hooks and make the same change.

    When it gets merged, then you can post it in @baris' breaking changes thread 😄

    pichaliteP 1 Reply Last reply
    0
  • pichaliteP Offline
    pichaliteP Offline
    pichalite Plugin & Theme Dev
    replied to julian on last edited by
    #5

    @julian Whaaaaaat??? 😢

    I will try to submit a PR. It's probably better to do a breaking change before v1.0.0

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development