EndangeringSpecies
EndangeringSpecies

Reputation: 1594

can I easily turn Joomla into fancy wrapper for a separate php script by using "articles" with embedded html/javascript?

I am asking because I have seen people say online along the lines of "joomla sucks because making a web app using joomla is hard due to poor API/architecture/docs/people on my lawn". Then these people talk about switching to drupal, ExpressionEngine or some other allegedly more webapp-friendly system.

So, I thought about the following (naively, perhaps) straightforward approach to making a joomla based webapp of arbitrary complexity and power. First I write my app as a standalone php script. I identify all of the distinct pages/forms I have in it and I create corresponding "articles" in joomla. So maybe if I am making a "forum" webapp I would have a topic list "article", topic "article" and edit post "article". Now, instead of having these articles be relatively static pieces of text in joomla database editable by joomla's logic, I have my separate php script (the actual web app) directly output whatever html (or text, or smarty - whichever abstraction level is best) into the corresponding article text record inside joomla's database. Naturally, if there is a button called "submit" in that page, it would submit not to joomla but rather to my script, most likely via ajax, and then reload the (joomla) page which by that time will have already been updated by my script.

So in a sense I have just gotten rid of the whole notion of "content" in joomla's CMS functionality and instead turned joomla into a shell or wrapper that displays pages from my script. Meanwhile I retain joomla's themes, nice admin panel, user management, media support, custom extensions etc.

Ok, so so much for the n00b theory. Now, would anybody like to burst my bubble? Is there a good reason why people don't do it like that? Or shouldn't do it like that? Or is this in fact one of the well known ways of turning a CMS into a web app?

Upvotes: 0

Views: 1538

Answers (2)

TryHarder
TryHarder

Reputation: 2777

Not sure if it is a good idea or not, but reading what you are doing reminded me of the Joomla Framework

One of the reasons people may not be modifying the CMS could be because they can use the framework to build what they need. I think for a beginner, your method maybe easier, but since I'm a beginner myself I can't really say if it is a good idea or not.

Taken from their page

The Joomla Platform is a platform for writing Web and command line applications in PHP. It is free and open source software, distributed under the GNU General Public License version 2 or later. The Joomla Content Management System (CMS) is built on top of the Joomla Platform.

From what I understand you get the bare essentials needed for your web app, but can still use Joomla plugin extensions.

More info here http://docs.joomla.org/Platform/11.1 and here http://docs.joomla.org/How_to_create_a_stand-alone_application_using_the_Joomla!_Platform

Upvotes: 0

Brent Friar
Brent Friar

Reputation: 10609

If you can code PHP, then you are better off just writing an MVC extension to begin with. The whole point of using the Joomla framework is to avoid having to write some of the repetitive code that is already handled by the framework. You'd be making an app that would be a pain to administer and extend doing it the way you described in the OP.

Anyone that says "joomla sucks because making a web app using joomla is hard due to poor API/architecture/docs/people on my lawn" hasn't looked at Joomla since it was v1.0 or they don't know what they are talking about. Joomla has a well documented API that can be used for anything you can come up with. In fact, the categories/articles in Joomla are just an extension called com_content and don't need to used at all for any reason.

Spend a little time learning the API and MVC and you will be happy you did.

API - http://docs.joomla.org/JDOC:API_Reference_Project

MVC Component - http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1

Upvotes: 1

Related Questions