Content Management - May 24, 2010 - No Comment
SEO Toaster CMS
SEO Toaster was introduced last week and it comes with a set of features that puts that solution right in place for competing with other famous systems. It’s also nice to note that the technology behind it is the Zend Framework.
Inline editing : all administration is performed within the actual site, the admin area does not exist. This is a particularly challenging choice of development but tends to please users when correctly designed. Visually the green & blue theme for the sidebar admin is not the best but is functionnal.
I particularly like the page creation form (image above) which allows the content manager to specify all page information, including SEO related, page title and header image, in one shot.
File Management uses the famous swfupload which is now a minimum requirement for CMS practise. Images are automatically resized and the upload process allows uploading and editing within the same screen which is a recipe for content efficiency. Jquery lightbox is provided in the distribution and resized images link to the original image automatically.
Form maker is integrated in the distribution too but only with the email sender feature, no database integration yet
Tips & Tricks - October 19, 2009 - No Comment
Use Zend_Form to create SQL table
A quick code snippet that uses a Zend form (in the case below, with subforms) to generate a SQL table create statement. Useful for scaffolding : create your form with Zend Form Elements then the SQL table automatically.
-
<textarea rows="50" cols="80">
-
create table yrbeaute (`id` int(10) NOT NULL AUTO_INCREMENT,<?
-
foreach($this->form as $k=>$subform)
-
{
-
foreach($subform as $k=>$element)
-
{
-
if ($element->getType()=="Zend_Form_Element_Select") $type="varchar(50)";
-
if ($element->getType()=="Zend_Form_Element_Radio") $type="varchar(50)";
-
if ($element->getType()=="Zend_Form_Element_Text") $type="varchar(255)";
-
if ($element->getType()=="Zend_Form_Element_Textarea") $type="text";
-
if ($element->getType()=="Zend_Form_Element_MultiCheckbox") $type="varchar(255)";
-
?>
-
<?=$element->getName() ?> <?=$type?>,
-
<?
-
} else
-
foreach($element as $k=>$elem )
-
{
-
?><?=$elem->getName() ?> varchar(50),
-
<?
-
}
-
-
}}
-
?> step int(5), `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
Content Management - September 24, 2009 - No Comment
5 Opensource applications built around Zend Framework
a lot of expereiences are currently being performed on the Zend Framework platform, but a few are really usable in production environement.
- Magento is obviously the best example of how Zend Framework can bring power and ease of development via a PHP enabled template system. The most popular opensource ecommerce application has been downloaded more that a million times and is still considered a revolutionnary project after 2 years of production.
- Digitalus CMS is a Zend framework based Content Management System. We covered it a while ago
- Joobsbox is a job board application developped on top of Zend Framewor, not quite stable yet (nice implementation of hirearchical tree does not handle sub pages very well yet, worth the try)
- Dodo is a perfect tutorial for starting with the Zend_Application environment, and it is also a good tasks application
- EasyPhpApp is a CRUD generator that can save you time when working with a lot of database tables (see our previous article on Zend framework scaffolding)
and also you can try, tine 2.0, a powerful groupware application that uses extjs beautifully (covered a while ago too on this blog)
Content Management - September 22, 2009 - No Comment
Cahaya, a cms for zend framework
At first sight, nothing really exciting comes from the newly released Cahaya CMS, built entirely around Zend Framework CMS : in fact the toolbar that switches the site to edit mode is an interesting implentation of  insite edition, that allows page building from selected and editable blocks, as illustrated below. The whole web content management interface is built with ext js widgets including drag and drop, and this looks promising, though apparently  quite complex at this early stage. I miss the hierarchical tree for page navigation in the admin, but let’s hope it’s coming.  go to http://cahaya-project.org/ for more.
Technologies, Web Applications - January 4, 2009 - No Comment
Generic Data save with Zend Framework
This technical article hilights one the famous ideal goal we all want to achieve : scaffolding, CRUD, BREAD, call it what you want, all we want is to get rid of repetitive sql query writing. Zend framework provides powerful data abstraction and here are a few tips to use Zend_DB_Table to its best. Of course this article assumes you have an idea of MVC development with Zend Framework.
Why are we doing this ? in the course of writing ajax actions, we needed our controller to react to any POST provided by specific forms : whatever the fields in the form, we want them to be saved to our table. Code below is a specific implementation of a controller that responds to specific ajax queries. Please bear in mind that it is only provided as an example of generic query action. Other portions of code are not optimal, such as viewless actions in the renderAjax method, not the best.
[update 20090428] Alternative : Â Smart save on Zend_Db_Table objects from zfsnippets
Controller Implementation
Our controller is a simple Zend_Controller_Action. We load the database model at init time, and specify the primary key (node parameter) in a class variable. Note that our data model is also stored in a class variable.
-
class UserController extends Zend_Controller_Action
-
{
-
public function init()
-
{
-
$this->session = new Zend_Session_Namespace(‘User’);
-
// $this->view->translate = Zend_Registry::get(’Zend_Translate’);
-
require_once ‘models/Users.php’;
-
$this->data=new Users();
-
$this->node = $this->getRequest()->getParam(node);
-
}
Quick look at the model
at this stage I specify on particular function I like to implement in Zend Framework Models : the primary key ! Other functions of the model could include add, delete and update : we’ll see below that our generic data admin prefers to do the job in the controller.
-
class Users extends Zend_Db_Table_Abstract
-
{
-
protected $_name = ‘users’;
-
public function primaryKey()
-
{
-
$info = $this->info();
-
return $info[primary][1];
-
}
-
}
Back to the crontroller : the renderAjax method is a quick one that stops the view from being rendered. If you are a specialist of Zend Framework you will notice that this can be better performed with the contextSwitch action helper. Use the code below only for testing, for production you’d rather spend a few minutes learning about helpers !
-
private function renderAjax()
-
{
-
$this->_helper->layout->disableLayout();
-
$this->_helper->viewRenderer->setNoRender();
-
}
Action !
Listing records is the first thing you want to look for when working at data scaffolding. the code below reads metadata from the table, lists all columns from your table, fetches data and returns them as JSON (ready for extjs grid display, by the way).
-
public function listAction()
-
{
-
$this->renderAjax();
-
-
if (null === $select) $select = $this->data->select();
-
-
$thRowSet = $this->data->fetchAll( $this->data->select());
-
-
$arrMeta=$this->data->info();
-
$arrCols=$arrMeta[cols];
-
-
foreach($thRowSet as $row ){
-
foreach ($arrCols as $v)
-
$arr_node[$v]=$row->$v;
-
-
$nodes[]=$arr_node;
-
}
-
-
}
The next step would be to add records : we have not worked on this yet so you’ll want to try this with tables that have a few records in them. The method below works with two types of data sets.
- Multiple column form submit :this would be the classical response to a from submission, where each field bears the NAME of the database field, and obvisouly the value is the data. Such forms are transmitted via FORM array with key / value pairs. We read the POST (getRequest->getParam) that match metadata built from the database table column array. We then provide a clean arrData array of new data for the update() method of our Zend_Db_Table instanciation. This method takes two arguments: the first is the associative array mapping columns to change to new values to assign to these columns. The second is the where clause that we built from the primary key
- Single column submit : the technique is useful when working with extjs in place editing, where one piece of code can edit multiple fields. The field variable contains the database column name and the value is the data. We add a check that matches the field against database table column names
-
public function saveAction()
-
{
-
$this->renderAjax();
-
$id= $this->node;
-
$key = $this->data->primaryKey();
-
$strWhere = $key. ‘=’ . $id;
-
-
$arrMeta=$this->data->info();
-
-
// all columns submit
-
$arrCols=$arrMeta[cols];
-
{
-
if ($v!="parent_id" && $v!= $this->data->primaryKey()
-
{
-
$arrData[$v]=$this->getRequest()->getParam($v);
-
-
}
-
}
-
-
//single column submit via field/ value
-
if ($this->getRequest()->getParam(‘field’)!="")
-
{$field = $this->getRequest()->getParam(‘field’);
-
$value= $this->getRequest()->getParam(‘value’);
-
$arrData[$field] =$value;
-
-
}
-
-
{
-
try{ $this->data->update($arrData,$strWhere);
-
-
}
-
-
}
A good start for extjs development : Hope this is useful for you !!
Content Management, E commerce, Web Components - November 10, 2008 - No Comment
Monday’s web applications
Javascript libraries
While EXTJS 3.0 is on the way with a roadmap setting deadlines for early 2009, Jquery continues its path on the way to serious lightweight alternative to the massive EXT : JX extension for Jquery includes the viewport paradigm on which relies every EXT JS application.
Web based interfaces
In spite of huge progress and impressive use of ease, Jquery is not there yet : for the development of applications many developers have chosen the exhaustivity of EXT JS. Have a look at google code hosted project in development : ecartcommerce, CMS jimw, both ext js and zend framework based. In the world of content management systems, mysource is making the news with a new video that demonstrates inline editing, and other exciting Rich Application features.
Web Applications - November 7, 2008 - 2 Comments
Zend Framework extensions
Zend framework might not be as popular as other famous programming frameworks such as CAKE PHP or symfony. But still it’s getting quite usable with version 1.7 approaching and a growing number of serious of libraries are hitting the ground. We’ve already covered code generation, scaffolding and RAD with Zend framework in  previous articles, this article covers lower level libraries from Zym Projet
Zym Project includes a powerful navigation abstraction that can help building pages hierachy in a CMS application for example. Other goodies include the bootstrap class, that takes all configuration from ini files (bootstrap class also exists in another ZF extension, ZENDEX). Some classes of Zym Project have been integrated into 1.6 official release of Zend Framework. API classes Reference guide is available online.
Web Components - October 22, 2008 - 1 Comment
Zend Framework hierarchical Zend_Db_Table extension
After a few hours looking for a good implementation of recursive data with Zend Framework, I came across Hector Virgen’s table abstraction for nested recursive tables, which uses the efficiency of the Modified Preorder Tree Traversal method that retrieves descendents and ancestors faster that with the old parent_id reference. In fact parent_id is not needed any more but in the example below we will keep the parent_id implementation. My aim here is to implement a draggable tree with data from this Zend_DB_Table abstraction. Setting up ext js with Zend Framework is not that hard, especially when many tutorials have been posted around for extjs tree with other frameworks such as Cake PHP .
Read the rest of this entry »
Content Management - October 21, 2008 - No Comment
Omeka : exhibit engine
what is nice about Omeka CMS is not the backend : you will find in the admin sandbox that most sections of the restricted area, while perfectly efficient, lack today’s common AJAX reactivity. But on the front end, the result is stunning : websites built with Omeka have all gone throught a graphic design expertise that push the enthousiast to look more into the technology behind (Zend Framework). As such the tool fits perfectly into its mission statement : “web platform for publishing collections and exhibitions online. Designed for cultural institutions, enthusiasts, and educators, Omeka is easy to install and modify and facilitates community-building around collections and exhibits.“
Web Components - October 17, 2008 - 2 Comments
Generate code for Zend Framework
Can Zend Framework do scaffolding like Symfony or Cake ? No, would you say after downloading the framework and trying out. But a quick search out there shows that you’re not the only one thinking about it. In fact there are many code generators out there for PHP Â : look out for Codecharge, codeigniter, or any cakephp like framework. What was missing was code specific for Zend Framework, which offers the great advantage of being developped actively and offers new versions often. A quick browse on french developers forum popped up a few applications to be tested, and looking a bit further I found some interesting implementations of scaffolding for Zend Framework :
- easyphpapp is a good start for manually building CRUD for Zend Framework,Â
- Zenerator is a PHP based application that builds classes for database objects out of templates and live database connection
- ZDBForm is quite old but is good enough to generate very quick  CRUD out of Zend_DB_Table
- GEckoToolbox has nice grid and form components. By the way Zend Framework V1.7 is coming out soon with Jquery support.
- Zend Framework data grid generates a table from Zend_DB_TAble
- Another Grid implementation for Zend Framework




