[nodebb-plugin-custom-pages] does it support restful parameters?
-
Is it possible to present the content (but same page) based on restful parameters?
Example,
http://127.0.0.1:4567/game/:name
; wherehttp://127.0.0.1:4567/game/dota
-> show dota game contentshttp://127.0.0.1:4567/game/hearthstone
-> show hearthstone game contents
The template for the page
/game
is the same but the content differ. Instead of creating multiple pages / routes for various games, can the plugin process the restful parameters and render the content accordingly. Is it possible with [nodebb-plugin-custom-pages] plugin?Please advise me, thanks.
-
ok, i found this.
https://community.nodebb.org/topic/244/example-plugin-with-paramterized-urldynamic-template@psychobunny can you advise me with codes example on how to process the parameter?
-
This isn't a templates.js issue really, this is a feature of express
Try this: http://expressjs.com/en/guide/routing.html#route-parameters
-
@PitaJ I understand that it is definitely possible with express. Thanks
However, I'm trying to use the plugin [nodebb-plugin-custom-pages] that @psychobunny has built to achieve the same goal instead of re-inventing the wheel. So my question is whether is it possible to process the restful / query parameters in [nodebb-plugin-custom-pages].
If its possible, is there any example configuration (in the plugin) and codes, showing the entry point to process the parameters. If not possible, then I will go back to use express router to handle the restful parameter and render the template.
-
Yeah, I just read the title and realized I totally failed to answer your question. Anyways, I don't believe that this is possible with that plugin.