Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
541 views
in Q2A Core by
edited by
I have been using Wordpress for years and I really love the simple structure of having individual files like header.php, index.php, post.php, categories.php in your theme folder which you can build according to template tags and WP functions.

However, after I used Q2A for a few days now, extending/editing functions with a qa-theme.php file feels a bit awkward to me.

Would Q2A not be (way) more functional (for developers) if it had a similar theme structure to Wordpress?

Something like: index.php, questions.php, tags.php, users.php et cetera, and then having template tags/functions like:  get_recent_questions(), get_askbox(), get_categories(), et cetera, to build these files?

1 Answer

+3 votes
by
 
Best answer
It's a fair question, which I've answered before, but let me answer again.

The problem with a template-based approach is that Q2A is evolving very rapidly, so a template-based theme would go out of date when a new version of Q2A is released.

By using an object-oriented approach to theming, it's easy for a new version of Q2A to change the necessary parts of pages, while still remaining backwards compatible with almost all themes already created.

The object-oriented approach also enables the 'layers' functionality in plugins, which allows one plugin to modify small parts of the HTML output, while being compatible with an unrelated plugin that modifies some other part.

In the long run, I imagine giving admins the option of using template-based theming or object-oriented theming, depending on whether they prefer flexibility + backwards compatibility, or ease-of-use. But there's still a lot more basic Q2A functionality that needs to be in place first...
...