Modify single user url structure
-
Hi @baris
Can we change url of specific group of users
Example :
Now
User A having urlhttps://mydomain.com/user/abcd
andUser B having url
https://mydomain.com/user/pqrs
and user A in group X , and user B in group Y
So
I want to make different url for X group user something like
https://mydomain.com/user-X/abcd
and for other users keep url as it is
https://mydomain.com/user/pqrs
please guide me how can i do this ?
-
could you give me some basic idea of that ?
-
You would need to create new routes in your plugin like so
helpers.setupPageRoute('/:groupslug/:userslug', middlewares, function (req, res, next) { // todo: get uid of user using req.params.userslug // todo: check if user is member of req.params.groupslug // todo: render account template with all data });
You can take a look at the core user routes on how to do most of this stuff.
Copyright © 2024 NodeBB | Contributors