Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
985 views
in Q2A Core by

now the  `type` field is  enum('Q','A','C','Q_HIDDEN','A_HIDDEN','C_HIDDEN','Q_QUEUED','A_QUEUED','C_QUEUED','NOTE') NOT NULL,
 

i want to add a new type 'wish' ..it will be convenient because i don't have to create a new table.

any help will be appreciated. smiley

 

Q2A version: 1.5.2
by
How would a "wish" post be different to the normal question and answer format? Do you need different form fields?
by
it can be identical.but the 'wish' type won't be show as question and answer,i will write new widget or theme and add new tab for it. alternatively,i may add some new fields later. so ,can i use the 'post' table this way?
thank you for help, i'm looking forward to hear more suggestions. :)
by
Responses asking "why would you want to do that" unfortunately are too common when the seeker is asking ("if possible" and) _HOW_

Although my use case wouldn't involve "wish" item type, I do believe the app's implementation would benefit from introduction of one or more additional item "types".

As an example, a posttype="article" would, I believe, encourage greater contributions from "experts". The poster's representation (and viewer's expectation) regarding an "article" type post would be that it (the content page, or "node") presents factual, if not entirely comprehensive and probably not authoritative, content. Perhaps no "answer" type reply option should be provided to viewers of such a node ~~ solely a "comment" type option.

Similarly (or perhaps alternatively, in the context of putting ONE additional "custom" type to use) an itemtype="discuss" might suppress the "answer" option (neither a definitive, nor "best" answer is expected).

Here's a good example (I think so):
In this q2a metasite, we're relegated to blindly searching across xx pages of possibly related... or posting a fresh (possibly, er, probably redundant) item. Whoa! a question like "How can I optimize q2a?" is MUCH too broad ~~ that topic cannot be comprehensively discussed in a single "item" thread. However, one, or a few "DISCUSS: optimization -- database" and "DISCUSS: optimization -- server" -type threads could (and would) serve as exploration starting points.

2 Answers

+2 votes
by
selected by
 
Best answer
This isn't a full answer but a few possible hints. Hope it helps.

In general this kind of stuff can be done with a plugin. You can probably keep the type as 'Q' in the database, but use another table to list which question IDs are your special wish type (or maybe use categories). That table can also have your extra fields.

Then you can use layers to modify the layout when the 'question' is your wish type.
by
Except a new type how can be possible to have a category that is visible ONLY to admin and not to all?
I need it because i have some questions that the admin must categorize with BUG FIXED and i do not want that the category can be used from users that can select it.
+2 votes
by

There should be no problem adding a new possibility to the type field, and it should mostly be ignored by Q2A.

However it sounds like it might make more sense just to define a new table for your specific needs. You won't get much advantage from having the content in the standard Q2A table, if it's not of a recognizable type.

...