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

On my website lektiesos.dk I use CKEditor. I want my users to be able to attach files to their questions (pdf, doc, etc), without having to go through 'Insert hyperlink' (which in my eyes is not very user friendly). So instead I would like to,

1) Place a button with the label "Attach file" just below the CKEditor.

2) Move the logic from file upload in the Insert hyperlink, to an onclick event for the new Attach button.

Would you know how to do 1) or 2) or maybe both, then please post.

Q2A version: Newest

1 Answer

+1 vote
by

You could have a look at the Extra Question Field plugin

by
Anyway, it was good to work. However, it is strange that value gets newline code. It cannot happen in my environment. And, there is not such report so far. There may be still another problem with your environment. In addition, EQF expands the feature that Q2A core has. Therefore, we cannot apply EQF to answer and comment. If Q2A core comes to have expansion field in answer and comment in the future, this plug in may follow it.
by
I suppose I could modify the Q2A core, so that it gets the expansion field on answer and comment? Or would that be difficult to do?
by
Primary key of qa_postmetas table is "postid" field. EQF add or update record (title="qa_q_extraX") in qa_postmetas table. This table may be available by changing title (e.g. "qa_a_extraX" / "qa_c_extraX"). However, question form already has extra field of the core, but there is not it in answer and comment form. Therefore, you will have to remodel answer form and comment form from a beginning. Because I have no experience about this, I have no idea about difficult level. Let's challenge!!
by
edited by
Thanks, I'll try to get it to work for answers and comments.

By the way, is there somehow I can make the plugin write a file attachment to a file in a directory on the webserver instead of the database? I think this would be a better approach to avoid the database growing too big.
...