Ask a question button code help
-
@psychobunny suggested to put the following in an html widget in order to create an "Ask a Question" button. You can see it on my forum page.
<button id="new-topic-button-widget" class="btn btn-lg btn-primary">Ask a Question</button> <script> $('#new-topic-button-widget').on('click', function() { require(['composer'], function(composer) { composer.newTopic(2); }); }); </script>
-
Thanks @zenkamal
A few things if can be done, will be nice
-
I clicked the button and made a post. It was posted in software help section. Is it possible to allow users to select the category or simply take to forum home page.
-
When clicks on logo, the button does not appear.
-
Is it possible to have a green coloured button with if possible a bit rounded edges ?
-
-
-
That's an existing feature request, scroll down on here.
-
Yeah, I haven't quite perfected mine either.
-
Yes, I'm guessing some custom CSS should do that...although probably someone better at that could point you in the right direction.
-
-
Not sure...I only have one category so it doesn't quite apply to mine.
-
Then remove the widget
-
@zenkamal said:
Then remove the widget
I kept it the same so that someone will be able to suggest how to modify it.
-
@meetdilip the reason it went to software on your forum is because of the
composer.newtopic(2)
. Going into each category will tell you it's cid in the URL, for now you could just have a default forum where questions go by changing 2 for the forum cid you want. -
Yep. I guess. Would be nice if we can choose board no. as well.
I am still not able to feature a thread.
Is there anything like html menu just like css menu ? Or any chance I can use a text menu which will help members find forums easily ? Please do tell me how.
Thanks.
-