Writing a CMS/Community with Smarty and the Zend Framework Part 1


Background
I’ll make this short so we can get on with the tutorial: The reason I’m making this system is that we use Joomla 1.5 for our CMS related stuff here and Community Builder (A.K.A Joomlapolis) just don’t work very well with 1.5. Alas, for the current project I’m doing we need some basic blog and gallery functionality for each member and as far as I know there is no real replacement for Community Builder. Checking out typo3 alternatives didn’t work out well either. At a quick glance CWT Community didn’t seem to have the features I was looking for, neither did HOI Community. Any Community looked more promising but the alpha status didn’t really excite me.

Tutorial
So the requirements for the system we are going to build are some kind of CMS capability combined with a community. In this first phase each member will have her own simple blog and gallery. The result will not be near as advanced as Joomla, especially when it comes to the admin area. This system will require people with some programming and designing skill to setup in order to get a new site going. Massive amounts of time and effort has been expended to make Joomla a simple thing to install and administer, time I don’t have.

Let’s start with more specific requirements:
1. We need to be able to insert components everywhere, just like in Joomla with the jdoc tag.
2. The designer has to be able to do as much as possible in the Smarty code. The reason for this is that we don’t want this to become some archaic thing that will require a lot of programmer effort to setup for each new project. We want to empower the designer! That this could mean less boring work for us programmers is another matter…

If you know how to instantiate controllers in the Zend Framework you know that #1 can be taken care of by a combination of instantiating controllers and the Smarty insert function. The way this will work is basically identical to the procedure described in the Smarty widget tutorial. The plan for the overall “flow” will look like this:
1. A call is made to the IndexController which is responsible for rendering the main page, for instance with a call to Smarty->display(). It will however assign various variables to the Smarty template which will be used to render other elements.
2. In the Smarty template code we now have Smarty insert functions which will load controllers based on the parameters they get and display the output from these controllers.
3. We also have a main content area that is passed parameters assigned in the IndexController which in turn got these parameters as a result of user interaction.

Source Code

  • Digg
  • del.icio.us
  • blogmarks
  • Reddit
  • Simpy
  • StumbleUpon
  • Technorati
  • description
  • Ma.gnolia
  • Slashdot
  • Sphinn
  • Spurl

Related Posts

Tags: , ,

Posts linking to this article:

ProDevTips Blog: Extending Zend DB Table
On the ProDevTips blog, there's a new post showing how to bend the Zend_Db table component of the Zend Framework to your will and customize parts of it for your application. For some time now I've been working on an administrative ...

CMS mit dem Zend Framework
Henrik Sarvell startete vor einiger Zeit damit, ein Content Management System auf Basis des Zend Frameworks zu entwickeln. Dies hat er auch enorm vorangetrieben und einige Teile davon veröffentlicht. Gestern hat er den (vorerst) letzten ...

links for 2007-12-09
oscmax 2.0 - oscommerce maximized. oscmax v2.0 is a powerful e-commerce/shopping cart web application. there are many advantages to using oscmax as your e-commerce/shopping cart for your web site. it has all the features needed to run a ...

[Web] 連結分享
PHP. The new way to write AJAX applications with PHP. 繼承phpajax 這個類別後,你就可以很方便地產生以AJAX 操作的HTML 元素。 The completely unofficial Xdebug.ini. 最完整的xdebug 可在php.ini 設定的項目及說明。 ...

ecrire un cms avec smarty et le zend framework
prodevtips publie un dossier en 5 volets pour mettre en place un système de gestion de contenu à l'aide de smarty et du zend engine. le tutoriel, destiné à ceux qui connaissent déjà le zend framework et smarty, réalise la gestion du ...

Subscribe with Google Reader