Which CMS would you choose if you wanted to create a Q&A forum?
-
@Tanner Wouldn't that require the ability to upvote topics? Unless you just displayed the number of votes that the first post has.
{posts.index}
returns 0 for the first poster inside a topic. You could then get the{posts.votes}
of that post and display it, however this information would need to be parsed into the api that topiclist uses (which it currently isn't), perhaps as a feature request, being able to specify certain parts of an api in different pages. Pipes and dreams. -
being able to specify certain parts of an api in different pages.
you could
$.get('/api/another/page')
-
@psychobunny Good thinking Batman.
-
Thanks @a_5mith for pointing me to this topic. So I have a question:
- On the category page, where the topics are displayed, I want to add content of the first post into topic. This is the failed idea http://screencast.com/t/q7FpL5nN3 . I couldn't do that because in the api of that category page there is no "posts" value. Could I make that happen with
$.get('/api/another/page')
? ( If yes, it would be nice if someone could explain that a bit deeper. ) Or I need some other solution?
- On the category page, where the topics are displayed, I want to add content of the first post into topic. This is the failed idea http://screencast.com/t/q7FpL5nN3 . I couldn't do that because in the api of that category page there is no "posts" value. Could I make that happen with
-
So to answer your question specifically - so every page has a designated API route as well. Take for example this page, which is
Which CMS would you choose if you wanted to create a Q&A forum?
What is the most modern and feature-rich Q&A-Creator? EX: Discussing forums such as: nodeBB QandA forums such as askbot What is a Q&A: I mean something like...
NodeBB Community (community.nodebb.org)
Just append /api at the start, and you can get it's data like so:
So from your plugin/theme, it's fairly simple to just do an API call to get it's data with
$.get
For your case, it's a bit more complicated because then you'd be making 20 API calls per page, so I actually wouldn't recommend this method. Here's a sample
library.js
for your theme (make sure that your NodeBB is completely up-to-date, as I only just added this hook).NodeBB plugin - adding main post data to category view
NodeBB plugin - adding main post data to category view - library.js
Gist (gist.github.com)
This will add the
mainPost
data directly into the category view - so in your template you'd be able to do something like{topics.mainPost.content}
@trevor you might find this useful as well.
@Jelena, for further reading you might find this set of articles useful. Hope I make sense here, GL
-
@psychobunny I followed your instructions above and as you can see here http://screencast.com/t/2sNjFqWK I succeeded to add
mainPost
data in my category view api. Then In category.tpl I added this code<div class="topicContent">{topics.mainPost.content}</div>
and the rest of the code is like in vanilla theme category.tpl .Still something isn't right, I got this as a result of what I did http://screencast.com/t/T7AYotKM . -
Thanks @psychobunny @baris!
-
@psychobunny @baris Btw, how to make this hook work on recent topics, or profile page? I tried to add in my plugin.json this:
{ "hook": "filter:recent.get", "method": "addPostData" }
but it didn't worked. Can I apply this hook to any page I need just with changing those filters or it is not that easy? -
Someone's tried it before: http://www.nutritionask.com/
With a bunch of widgets, changes in the design. And now you can sort by upvotes too so it's probably much more possible to do a Q&A style site than it was a month ago when you first asked