Blog of Attomsoft Inc.
How to build a stackoverflow or Yahoo! Answers like system using Drupal (Part2)
We’ll create the two content types which will be used by our Q&A system in today’s part-2.
The Questions content-type fields:
- Question title(Module form [title])
- Question description(Module form [body])
- Disable comment option if you don’t want users comment on the question itself.
- Points: field_question_points, type[integer], default value[0], set as required, minimum value also as 0
- Answers: field_question_answers, type[nodereference count], set as required, the “nodereference field that can be counted” option should be set to the field name that we’ll create it in “Answers” content-type in step 2. (So you could just process #5 field)
- Best answer: field_question_best_answer, type[nodereference]. Save the content type here and we will refine it later.
The Answers content-type fields:
- Set “Automatic title generation” option to “Automatically generate the title and hide the title field”, you can set the automated title pattern using tokens available there.
- Disable the comment option if you don’t want user comment on answers themselves. Or leave it R/W just like Stackoverflow.
- Target Question field: type[nodereference][nodereference from url], select our previously created ‘Questions’ type for referring.
- Selected Answer field: type[integer][Single on/off checkbox], set allowed values as ’0|No’ and ’1|Yes’ (that’s separated lines)
Here, we’ll go back to the “Questions” type and re-configure it:
- The “nodereference field that can be counted” of the “Answers” field should be set to our just created “Target Question” field.
- The “Content types that can be referenced” of the “Best answer” field should be set to our just created “Answers” type.
If you want to allow free tagging feature, here’s how:
- Create new vocabulary named “Tags” or something you prefer.
- Select the content types we just created which will allow using terms below this vocabulary and its free tagging feature.
- Enable the “Tags” option for this vocabulary to allow users free tagging
That’s all basic content types we needed for our Q&A system, we’ll build the needed views and panels in our next part tutorial.
See ya.
| Print article | This entry was posted by Sean on April 26, 2010 at 11:17 am, and is filed under Drupal. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
about 1 year ago
nice blog design. just the divs could need some changes
could be that it’s a free code?
whatever i stop to chat, just wanted to let you know.
about 1 year ago
Hello
when are you going to post remaining modules
about 1 year ago
Hi,
We re going to implement the same functionality in our website along with the views(no of people viewed that question). Could you please post the next part asap. It would be of great help to us. Thank you.
about 1 year ago
Nice tutorial, but where’s the next part?
about 1 year ago
Guys, refer this nice tutorial
http://engineeredweb.com/blog/09/11/building-stack-overflow-clone-drupal-part-1
cheers
J
about 4 months ago
thanks for the information,
i will try it..
about 1 month ago
mulberry sale