Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
2.5k views
in Q2A Core by
If there's demand, I'm happy to add more types of modules that can be registered by Q2A plugins. In what specific ways would plugin creators like to extend Q2A, which are not currently possible with the current modules?

4 Answers

+4 votes
by
edited by

I don't know about module types but as I mentioned before I would like to see new events in the event plugin that run before content is actually saved to the database. For example q_before_post, a_before_post, q_before_edit and so on.

Also another idea that came to me yesterday - I think a Custom HTML Widget would be very useful. I found myself creating some widget plugins just to show basic content in the sidebar on specific pages.

Under Admin>Layout, instead of all the "Custom HTML in..." options, you would just create a new HTML widget then choose (a) what position it would go in (top, sidebar, side panel, bottom, etc); (b) what pages it should be displayed on (questions, tags, ask, etc); and (c) the module content itself. Advanced content like question lists would still need a normal plugin.

EDIT: just thought of something else. I don't know if you are planning to add badges to Q2A natively (if so, I recommend integrating Noah's plugin if possible) but if you are, then some way to extend badges would be great. So you can create your own conditions like "asked 10 questions in tag X" or whatever. That might be quite a big task though.

by
@gidgreen yes, in my head I was assuming it would run before Q2A's content checks are run. So it'd call "process_event" almost immediately with the question/answer in $params (just like the current events). Now if you delete all the tags for example, and you have "minimum 1 tags" option, Q2A would now return an error, just like it does now if you submit the form without tags. It also saves running too many SQL queries on every event. Hope that makes sense!
by
@propongo you can do that now using custom themes.
by
@DisgruntledGoat, yes I know, I did that. But plugins instead of templates let more flexibility for great development and it is better for distributing to other users in a plugins database.
by
@propongo you can actually create plugins now that override the theme layers, I don't think you need specific events for that.
+2 votes
by
I don't know if module is the right name for it, but it would be nice to tap into the database rebuild functions; the badge plugin, for example, has a rebuild function, but it would be nice to somehow fit it in with the ajax-based rebuild functions - I tried fitting it in that page with a layer, but I think it needs some core hacking to make it work properly - either that or "reinventing the wheel" at my end.

Also, maybe a list module that allows for custom lists in the Questions nav's sub nav.  And maybe in the same vein allowing plugins to have their own admin subnav tab if they choose.

And I guess a language module would be a solution to the plugin translation issue, however that would work.

Also, it would be super nice if plugins could have an update check and download ability like Wordpress, though that would require some sort of plugin repository I guess.
by
Re #2, I think having links on the admin plugins page to sub-sub-pages would be good, i.e. /qa/admin/plugins/q2a-badges.
by
Database rebuild functions - it's probably a bit too involved for 1.5, but I can see that it makes sense in the longer term.

It might not be quite as easy as a specific routine, but you can already modify the question tab's sub navigation menu using a layer.

Allowing for plugin translation is something I will look into.

Update checking for plugins (and themes) is a good idea. I don't think I want to go down the route of a centralized repository like WordPress, at least not yet. So how do you think this should be implemented? A small text file that the developer puts on the Internet, containing the version number, and whose URL is specified as part of the metadata in qa-plugin.php. Any better ideas?
by
Thanks so much :) I think the text file idea is probably good enough; github has links to raw files, so we could just include links like:

https://raw.github.com/NoahY/q2a-badges/master/version.txt
(this file doesn't exist yet)

in the metadata.

The best part would be if there were some way to implement one-click upgrading, though I guess that is a security concern.  Not sure how Wordpress does it.
by
Wordpress uses FTP to upload the files to your server. I think something that advanced would be a lot further down the line for Q2A to be honest!
+2 votes
by

Here's another plugin feature that would be nice... permissions.  It would be nice if a plugin could add permissions to the list  qa_get_permit_options();, then they would show up in the permissions page and could be accessed by other plugins, like the privilege plugin I made.

 

by
Great idea, that would be useful for my chat room plugin.
+3 votes
by
I'd love the ability to add a bounty to a question.

Points from answering questions can be used towards the bounty.
...