I have the write api plugin installed as well as the question and answer plugin. We are successfully creating topics and posts. Is it possible to create a topic as a question? I tried adding isQuestion (equals 1) to the POST body when creating the topic but it was ignored. Would the write-api have to be forked and updated to support the optional value of isQuestion? It seems clear in the question and answer plugin that it doesn't create/expose any write api of its own.
Solved Open new topic composer
-
hi, is there a route, or link to open New topic composer other than the New Topic button?
the goal is to add another menu or button on top (along with tags, popular, recent etc, or persistent on the corner) to open composer window to add new topic (easy access) - since when user are inside a thread/posts - user need to go back to make a new topic.thanks!
-
@outboks Yes, I think you can do it without writing additional code (except the code to add the button).
Just add a button and make sure you set the
id
attribute for that button tonew_topic
and it should work. -
hi @pichalite, it doesnt work, i did set the id
-
@outboks that will only work for a button added on the page itself. Doesn't work for header.
-
ah oki, i wil test that, thanks!
-
@outboks Hmm, that's probably my fault. There's no reason it shouldn't work on the header that I can think of.
Change this line here and it should work.
https://github.com/NodeBB/NodeBB/pull/5003/commits/fc68b64fe0565a9252c7f54a82b455f800658c97 -
@yariplus that doesn't solve the problem completely for header. Links in header are anchor tags so page will reload before opening the composer unless you modify the header and add the link manually with
data-ajaxify="false"
-
@yariplus
works! - thanks a bunch!
-
@pichalite said in Open new topic composer:
@yariplus that doesn't solve the problem completely for header. Links in header are anchor tags so page will reload before opening the composer unless you modify the header and add the link manually with
data-ajaxify="false"
it works, as anchor i use '#' - it seems t does not reload the page, should i add the data-ajaxify="false" as well?
-
@omedia aah yes... adding
#
in route should work. No need for data-ajaxify in that case.Totally forgot about that.