mksafi
(M.K.)
May 26, 2022, 10:54pm
1
Been doing a lot of work around Discourse lately and really love the software! Very well thought out, thank you!
One feature request: a link that automatically opens the reply composer, or asks the user to login and redirects them to the reply composer after a successful login. Basically exactly like How to create a new topic link with pre-filled information but for replies.
Thank you!
1 Like
renato
(Renato Atilio)
May 26, 2022, 11:43pm
2
I use something like this:
I use a simple theme component for this in my instance. Below is an adaptation from mine – which also accepts #upload (a new reply opening the upload window on desktop) and #edit (for wiki OPs) in addition to #reply.
It needs some work, like avoiding setTimeout and correctly managing draftSequence (I don’t think topic.draft_sequence is right), and I don’t know what would be the best practice here. That said, it’s working fine for me.
Navigating to any topic like /t/[slug]/[id]#reply will open …
4 Likes
mksafi
(M.K.)
May 27, 2022, 2:54pm
3
This seems to work. I added the code in the API initializer of my theme. Thank you!
1 Like
mksafi
(M.K.)
May 27, 2022, 6:14pm
4
I just realized that this solution doesn’t ask the user to sign up or log in, if they’re not.
renato
(Renato Atilio)
May 28, 2022, 6:10pm
5
I think you can have some logic in the theme component to show the login page if the user isn’t logged in.
What I currently do, linking from another site, is enforcing the login flow like this, but I’m not sure if this works if you’re not using SSO:
SITE_URL/session/sso?return_path=/t/slug/id%23reply
Having it in the theme component is better to avoid unnecessary redirects anyway, I’ll try improving it when I get a chance (I’ll comment here if I do).
mksafi
(M.K.)
May 28, 2022, 6:31pm
6
Renato Atilio:
What I currently do, linking from another site, is enforcing the login flow like this, but I’m not sure if this works if you’re not using SSO:
SITE_URL/session/sso?return_path=/t/slug/id%23reply
Just tried it. Returns a 404 since I don’t have SSO enabled I guess
system
(system)
Closed
June 27, 2022, 6:31pm
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.