Welcome Guest, Not a member yet? Register   Sign In
MVC-CMS integration
#1

[eluser]sawatdee[/eluser]
Has anyone used an MVC framework (CodeIgniter, Zend, Cake, etc.) and a CMS (Drupal, Joomla, WordPress, etc.) together on the same site/page? If so, how did you fit them together and what did you think were the pros and cons of using both?

I like the freedom of MVC, but I also like the convenience of CMS, however MVC and CMS have quite a bit of redundant functionality so it never seemed worth my time to learn a CMS. Are there any third-party CodeIgniter libraries or helpers that provide the benefits of a CMS within the MVC framework? For example, a user management library or theme helpers.
#2

[eluser]Michael Wales[/eluser]
Most CMS have their own request handlers - it would be a much more work than it was worth to make Drupal/Joomla/etc. use CodeIgniter's routing class. I could see some use in including the CodeIgniter libraries for use in extension development but if you look hard enough, most of those CMS systems will have comparable functionality you can use. It still wouldn't be that hard to use a CI library - just cleaning up constant variable definitions I am sure.

I have seen people use a CMS (Wordpress, usually) as the backend of a site and then develop their own front-end using CI. This is really simple and can get you a site launched pretty quickly. Just upload Wordpress, deleting the request handler index.php in the root directory (you'll only be using the wp-admin directory to access the back-end). Then upload your code to the root (your code would read the WP database and do whatever it wants with the data, like - display it to the user). In most cases, it's a better idea to just design a new WP theme/extensions to handle your front-end, rather than designing a whole new system to work on top of a WP back-end.
#3

[eluser]muttlogic[/eluser]
I've developed data-intensive applications in CI on sites that use WordPress and other CMS on the front-end. The biggest issue I've found is how to render the CI application within the CMS template (including, typically, dynamically-generated navigation menus).

The approach I've used that reduces the coupling between the CMS and CI is as follows:

* Within the CMS template, include recognizable tags embedded in HTML comments.

* Use Curl within the CI application to fetch this page and parse out the HTML code that encapsulates the content area (which are easily parsed using the tags mentioned above).

* Generate views with CI using the extracted template described above.

I've simplified this this a bit, buy you get the idea. Using this method, the CI application automatically adjusts template sections dynamically generated by the CMS without the user, programmer or designer being involved.

If you're concerned about the runtime of the Curl fetch of the CMS page, you can also run a crontab job that extracts the template automatically ever 'N' minutes and sticks them into files. The CI application can then just read the template from the files. This will allow the CI app to run faster while still adjusting automatically to changes from within the CMS.

-Jeff
#4

[eluser]John Fuller[/eluser]
If you want to use an existing CMS, just take the time to learn how to build add-ons to the thing. Your end result will be much better.

If you still think a CMS is too restrictive, then you probably don't want to use it at all. Build your own system from scratch.




Theme © iAndrew 2016 - Forum software by © MyBB