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:

  1. Question title(Module form [title])
  2. Question description(Module form [body])
  3. Disable comment option if you don’t want users comment on the question itself.
  4. Points: field_question_points, type[integer], default value[0], set as required, minimum value also as 0
  5. 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)
  6. Best answer: field_question_best_answer, type[nodereference]. Save the content type here and we will refine it later.

The Answers content-type fields:

  1. 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.
  2. Disable the comment option if you don’t want user comment on answers themselves. Or leave it R/W just like Stackoverflow.
  3. Target Question field: type[nodereference][nodereference from url], select our previously created ‘Questions’ type for referring.
  4. 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:

  1. The “nodereference field that can be counted” of the “Answers” field should be set to our just created “Target Question” field.
  2. 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:

  1. Create new vocabulary  named “Tags” or something you prefer.
  2. Select the content types we just created which will allow using terms below this vocabulary and its free tagging feature.
  3. 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.