• 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

Way to get req (and maybe res) objects during a widget render?

Scheduled Pinned Locked Moved Plugin Development
9 Posts 3 Posters 2.7k 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.
  • jongarrisonJ Offline
    jongarrisonJ Offline
    jongarrison Plugin & Theme Dev
    wrote on last edited by
    #1

    I'm working on a widget that needs access to the current req object to access information that isn't included in the provided data of the hook: filter:widget.render:widgetName

    Is there a way to do this? If not, is there a good reason that we don't have access to the current request while rendering a widget?

    Thanks!

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

    This may be something @psychobunny can work into his eventual widgets refactor 😄

    1 Reply Last reply
    1
  • psychobunnyP Offline
    psychobunnyP Offline
    psychobunny
    wrote on last edited by
    #3

    The widgets refactor is far down on my current priorities so if you think you can PR the feature you requested I am more than happy to accept. 🙂

    If not, feel free to make an issue on GH

    1 Reply Last reply
    0
  • jongarrisonJ Offline
    jongarrisonJ Offline
    jongarrison Plugin & Theme Dev
    wrote on last edited by
    #4

    I don't know what PR means in this case, but I'll help you find some. 🙂

    I think I have found a workaround, but it feels like a hack.

    1 Reply Last reply
    0
  • psychobunnyP Offline
    psychobunnyP Offline
    psychobunny
    wrote on last edited by
    #5

    I meant a pull request on GitHub, if you thought you could modify nodebb core to work the way you want it to I'd be happy to merge it in

    1 Reply Last reply
    1
  • jongarrisonJ Offline
    jongarrisonJ Offline
    jongarrison Plugin & Theme Dev
    wrote on last edited by
    #6

    Nice! I'll look at what it takes.

    1 Reply Last reply
    0
  • jongarrisonJ Offline
    jongarrisonJ Offline
    jongarrison Plugin & Theme Dev
    wrote on last edited by
    #7

    I made the additions and created a pull request: https://github.com/NodeBB/NodeBB/pull/3555

    1 Reply Last reply
    0
  • psychobunnyP Offline
    psychobunnyP Offline
    psychobunny
    wrote on last edited by
    #8

    Looks good to me. Just waiting on confirmation of CLA 🙂

    1 Reply Last reply
    0
  • jongarrisonJ Offline
    jongarrisonJ Offline
    jongarrison Plugin & Theme Dev
    wrote on last edited by
    #9

    Cool! Just signed it.

    1 Reply Last reply
    1

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