<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aviblock.com &#187; cms</title>
	<atom:link href="http://www.aviblock.com/blog/tag/cms/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aviblock.com/blog</link>
	<description>My musings on web development</description>
	<lastBuildDate>Thu, 03 Jun 2010 13:40:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Review of the Apostrophe CMS for symfony</title>
		<link>http://www.aviblock.com/blog/2010/04/21/review-of-the-apostrophe-cms-for-symfony/</link>
		<comments>http://www.aviblock.com/blog/2010/04/21/review-of-the-apostrophe-cms-for-symfony/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 02:15:30 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[apostrophe]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.aviblock.com/blog/?p=95</guid>
		<description><![CDATA[I know I gave my blessing before to diem, and I&#8217;ll still admit that it is a very good CMS. However, it has always bothered me a little bit just how invasive this CMS is. While it bills itself as a symfony plugin, it is in truth anything but. You must start out using diem, [...]]]></description>
			<content:encoded><![CDATA[<p>I know I gave my blessing before to diem, and I&#8217;ll still admit that it is a very good CMS. However, it has always bothered me a little bit just how invasive this CMS is. While it bills itself as a symfony plugin, it is in truth anything but. You must start out using diem, and then add a little symfony in when you need it.<br />
I was reading, recently, a <a href="http://www.sympalphp.org/blog/the-status-of-sympal-a-call-to-the-community">post</a> on the sympal blog. In this post, Ryan Weaver echoed my latent feelings that a CMS should <em>empower</em> your site with CMS capabilities, but should not take it over completely. In other words, the perfect medium would be in the form of a plugin for symfony 1.x, or bundle perhaps for Symfony 2.x.<br />
There was a <a href="http://www.sympalphp.org/blog/the-status-of-sympal-a-call-to-the-community#comment_39">comment</a> put in there by somebody from the apostrophe team, which made me realize that, apostrophe was perhaps already meeting this goal. Seeing as I needed to pick a new CMS for an upcoming project, I thought I&#8217;d take it for a spin.<span id="more-95"></span><br />
I&#8217;ll start with, what is in my opinion, the basic backbone of what any CMS should be able to do.</p>
<ol>
<li>The first thing, I believe, is managing your websites structure and hierarchy of pages. I don&#8217;t consider this to be the same thing as content, but it is certainly fundamental to a website. Even if your site contains some applications (a blog, a wiki, etc.), there should be a way of shoving them under this rubric, as well.
</li>
<li>The next thing, of course, is managing content. Its not called a <strong>content managment</strong> system for naught, after all. Unfortunately, content is a very overloaded term. Most CMS&#8217;s seem to connect that to your site&#8217;s page structure. Create a page, throw up a WYSIWYG editor, and viola! Some CMS&#8217;s take a more fine grained approach, and consider content in a more abstract light. Content would be comparable to a data structure in a programming language. I believe <a href="http://ez.no/">ezPublish</a> even goes as far as calling content &#8220;classes&#8221;.</li>
<li>Lastly, a CMS should be capable of creating pages which don&#8217;t fall under the rubric of your page structure directly, for example, an article section. You probably don&#8217;t want an entry in your navigation for every single article, but you definitely want a clean url like http://mydomain/articles/this-is-an-article
</li>
</ol>
<p>With that in mind, let&#8217;s talk about the &#8220;theory&#8221; of apostrophe, and how it approaches these scenarios. As far as content, apostrophe seems to have found a ground between the above mentioned approaches. On the one hand, content does not directly equal a page in your site, but <em>can be </em> closely associated with it. On the other hand, content is not relegated to the abstract world of boring data entry forms, but actually real live snippets of html, which can be controlled through boring data entry forms, or an rss feed, or a youtube video, or anything you want if you have some creative ideas.<br />
With apostrophe, the we start out with the concept of a page. A page represents (almost all the time, but we&#8217;ll get to that), a public facing url on your site. Each page is backed by a slug. A page is rendered using standard php + symfony helpers. There is one layout, and each page has a template associated with it. There is no easy way, at the moment, to switch this layout, but there really shouldn&#8217;t be much of a reason why you would have to.<br />
On the layout that comes with apostrophe, are a number of symfony slots, which are filled in at various points by apostrophe. These are generally things like menus or breadcrumbs.<br />
Each page, has more than one &#8220;area&#8221; in it. An area is like a content holder. It can hold various types of content, stacked vertically. Each area has a name and is associated to a page. A template helper is provided to render these areas in your template.<br />
When an area is rendered, and you are logged in with sufficient privileges, you have the ability to add content to this area. These are called slots (not to be confused with symfony slots). There are enough built in slots to put together any run-of-the-mill website fairly easily, and creating custom slots is not terribly difficult. Some of these include, plain text, rich text, video, slideshow, pdf. Each slot comes with a displayable interface (normal mode), and an editing interface (edit mode). The edit mode can be a simple form, or it can be a complex multistep, workflow-engine powered web application (see the image slot). The edit mode is powered by a component called editView. The content for the slots is, wisely, stored as a serialized php array, instead of physical columns in a database table, although the latter is certainly possible if not discouraged. This is somewhat similar to the current trend of NoSQL databases, and somewhat similar to the approach that <a href="http://bret.appspot.com/entry/how-friendfeed-uses-mysql">friendfeed</a> used when scaling their database. It would have been better, in my opinion, to store the information in JSON instead of serialized PHP, or to use an actual NoSQL database, but there is nothing stopping you from implementing your own content slots this way. When the content is not in editing mode, the display is governed by a component called normalView, where you can, of course, massage all your data as you see fit before displaying it in the components template. Each content slot is essentially a module, with two components (editView and normalView), a model class and usually a form as well. This makes it fairly trivial to create custom content slots, especially if you have prior symfony experience.<br />
You also have the option of what is called, under the hood, a singleton area. An area which contains one and only one content slot. There is a special view helper for this as well called a_slot (as opposed to a_area).<br />
By default, each content area is associated with the slug, and therefore the page that its on. In that respect, content and pages are somewhat analogous. For a basic site, this may well give you enough mileage to go. However, the developers realized that there is room for content which is not owned by any particular page, for example, global content. This could be an editable footer or logo which makes its way into the layout. They also recognized that not every page in a website is physically there. They call this concept &#8220;virtual pages&#8221;, and it allows for some very interesting things. Every content area, both infinite and singleton, can be assigned to a &#8220;virtual page&#8221;, and thereby pulled out in any physical page, no matter what slug it has. Virtual pages are distinguished by virtue of not have a leading &#8220;/&#8221; in their slug name, thereby removing them from the realm of the navigation. One use case I came up with, was having a sidebar in the layout, but having the content of the sidebar different for each page. In order to do this, I had to specify a slug that was guaranteed to be unique for each page, so I called it something like &#8220;sidebar-$page->id&#8221;. I will discuss another use case later.<br />
As I mentioned earlier also, a CMS should also be able to handle pages which shouldn&#8217;t exist in your navigation, such as articles. For this, they came up with the concept of engines. Basically, instead of having your page rendered via apostrophe, it gets sent to a regular symfony module, written to certain conventions. You could have an module which renders an article page, based on an id in the url, but this page will still be under the rubric of your site. As an additional bonus, since its a regular symfony module, rendered by a regular symfony template, you can use the apostrophe helpers, and put content areas in a virtual page with a slug derived from the article&#8217;s id. This was the other use case I was referring to earlier.<br />
This cms follows the principle of less is more, and because of that, it is a clean, elegant system, with almost no learning curve.<br />
That is not say it does not have some problems. The admin view requires that the content areas be surrounded by a swath of DIVs. Unfortunately, these DIVs make it into the end user mode. My designer was not so happy to hear that the recommendation was to &#8220;embrace the DIVs&#8221;.<br />
Also, the page gets loaded with a lot of incoherent, redundant, inline javascript. Both inline in the page, and sometimes inlined on the element itself. There is no Javascript framework such as what comes with diem. For example, when you click &#8220;add slot&#8221; in an area, you are greeting with a very eye-appealing dropdown box. Unfortunately, to mimic that behavior seems to require a lot of copy and pasting.<br />
Certain areas of the code also look suspect and &#8220;hackish&#8221; to me. Any class named &#8220;aTools&#8221; with only static methods is certainly a red flag. Of course, symfony 1.x also has code like this as well, but that doesn&#8217;t mean that bad habits should be copied. Virtual pages are implemented, by temporarily switching a global variable (disguised a static variable), which holds the current page&#8217;s slug, for the duration of the rendering, until when the global variable is swapped back to its original state. This feels like hacky code to me.<br />
Over all, I have to certainly commend the developers of apostrophe. They managed to come up with good solutions for some classic problems in web development. They managed to create a tool which is good for end users *and* developers at the same time. Certainly not an easy task.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aviblock.com/blog/2010/04/21/review-of-the-apostrophe-cms-for-symfony/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Diem, my new CMS of choice</title>
		<link>http://www.aviblock.com/blog/2010/01/04/diem-my-new-cms-of-choice/</link>
		<comments>http://www.aviblock.com/blog/2010/01/04/diem-my-new-cms-of-choice/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 17:57:30 +0000</pubDate>
		<dc:creator>Avi</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[cmf]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[diem]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.aviblock.com/blog/?p=89</guid>
		<description><![CDATA[Every since I started getting frustrated with Expression Engine, I was always looking out for something different. A CMS aimed at developers. Just about every CMS on the market is aimed at letting less technical people get out their and create content. There are a few CMSs that bill themselves as a Content Management Framework. [...]]]></description>
			<content:encoded><![CDATA[<p>Every since I started getting frustrated with Expression Engine, I was always looking out for something different. A CMS aimed at developers. Just about every CMS on the market is aimed at letting less technical people get out their and create content. There are a few CMSs that bill themselves as a Content Management <em>Framework</em>. In other words, they provide with the tools to create your own custom CMS. In fact, I would actually put Expression Engine in that category. Others that come to mind are Drupal and EzPublish. Both of these, for some reason, I was never able to wrap my head around. Then again, I never spent much time with them either. Drupal is written procedurally (at least they admit it) which is not my style. Something always goes wrong when I try to install EzPublish.<br />
Then of course there is the option of <a href="http://gadgetopia.com/post/5940">RDBMSWAAS</a>. When thinking about that last option, there are two frameworks that come to mind, Symfony, and Django. I tried Django before for a small project, and it worked out well, but I had never really given Symfony the time of day. When looking at the Symfony website, I stumbled across a nice hidden gem.<span id="more-89"></span><br />
That gem is called <a href="http://diem-project.org/blog">Diem</a>, and it is a CMF written on top Symfony, masquerading as a plugin. Out of the box it can do some pretty cool stuff, which all boil down to placing intelligent widgets on your page, which strikes me as the cleanest way to make a webpage with some dynamic features on it, or even a full blown web app.<br />
What does Diem add to Symfony? Out-of-the-box, Symfony is probably the most &#8220;modular&#8221; of all PHP frameworks. Its modularity rings heavily of Django. It happens to be super easy to create distributable mini-applications. A symfony project is made up of applications, and each application is made up of modules. The project, applications and the modules within the application all follow a similar structure for configuration which makes for nice &#8220;cascading effect&#8221;, whereas an app contain override configuration from the project, and a module can override configuration from an app (and the project of course). Not only that but you can merge two different configurations from a module provided by a plugin and your own local version of that. This, we&#8217;ll see, can make for some nice extensibility.<br />
My biggest gripe with the framework, and it really is not a fault of its own, but probably of Symfony, is the blatant misuse of inheritance. There are certain components which have inheritance hierarchies running 4 or 5 levels deep. I have not yet gone through the whole framework, but I have not encountered an Interface in any of the core components, such as the front controller, and the router. This kind of encourages extensibility via subclassing, as opposed to implementing interfaces. Hopefully Symfony 2.0 will alleviate some of this.<br />
That being said, the best part of Diem is the extensibility. By virtue of the fact that it is written on top of Symfony, you have some good extensibility built in right away. Many core components can be swapped out using factories.yml, and the core Diem components (which are already replacing the symfony ones), are no exception to this.<br />
As I explore the framework, I&#8217;m trying to make a series of posts on Diem can be extended and modified, including some (at least for now) undocumented features that I&#8217;ve discovered.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aviblock.com/blog/2010/01/04/diem-my-new-cms-of-choice/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
