First time here? Check out the FAQ!
0

new type of post..
 

Hello

What do you think would be the best way to create a new type of 'Post'?
(other than question/answer/comment/tag_wiki/..)

Specifically, I'd like to add translate type.
It will have two texts/htmls/authors/edit_dates and etc, one for each language.
For example, english text -> korean text translate,
we would need one author field for english another for korean.

Please advise me how to add such a post type.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
pcompassion's avatar
21
pcompassion
asked 11 years ago, updated 11 years ago

Comments

pcompassion's avatar pcompassion (11 years ago)
see more comments

1 Answer

0

To answer your question - it is possible to create other post types by using a different value for the Post.post_type but there may be a bit of pain as there are some checks in the code similar to:

if post.post_type == ...:
elif ...
else:
    raise NotImplementedError()

So you will have to change some of that code or think of how to fix it so that adding another post type does not create as much resistance.

We would actually like to develop the UI for the translation of posts into different languages, but thinking of keeping questions and answers in different languages largely decoupled - in the same style that wikipedia does, but provide links between the translated pairs of questions. It will be very difficult to keep all the structure of questions, answers and the comments in sync between the various translations.

Unlike wikipedia though we do support multiple languages working on the same instance.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago, updated 11 years ago
link

Comments

Thanks for the input. My translation_type would be something different from what you describe at the moment. Mine would show two versions in different languages side by side in one page.

pcompassion's avatar pcompassion (11 years ago)

Ok, then you might need to make some changes in askbot code base - perhaps those changes might be integrated into the askbot app as is - so that it would be easier to create new post types in the future. Seems like you'll need to maintain either a fork or some sort of extensions to achieve your goal.

Evgeny's avatar Evgeny (11 years ago)
see more comments