Essential extensions

A little background on me: I’m kind of a low-intermediate PHP user who’s spending a lot more time focusing on C, to learn the essential ground rules of programming. In the past, more of my experience is in configuring, rather than coding. I was a heavy CMS user, primarily using Joomla and Drupal, until I started building my own sites from the ground up. I’ve found that building sites from scratch creates the need for an endless stream of auditors who always say the same thing: “your code is insecure, deprecated, unelegant, redundant, and slow!” So, here I am, picking up Yii…

In Drupal, there are an essential few modules that basically run things. With this small handful of modules, users can literally create any website. Time after time, I’ve found the easiest, most reliable way to get a site online, and indeed to teach someone to put a site online, is to walk through these essential modules. Themeing aside, all the functionality necessary to create a top-of-the-line site is contained in this short list.

That said, the purpose of this post is to make a short list for Yii. I hope to model it after what I know, which is Drupal. If I can find Yii extensions that parallel the essential Drupal modules, then I’ll obviously be set. Actually, considering as how Yii extensions are easier to read than Drupal modules, I’ll be several steps ahead of where I am, now. I can’t get around the idea that there’s a different short list for Yii. Some set of perhaps unsimilar extensions, when put together, create the same result–they sort of ‘make all things possible’. So, I’m very interested to hear from more experienced users on either of these questions:

  1. Do you have a shortlist? If so, what does it look like (please, provide links)?

  2. If you have any experience with Drupal, can you find an extension to match the following modules?

Rules, relations, blocks, views, views slideshow, and taxonomy. I’ll describe them for people who haven’t used drupal, but I doubt there will be much interest because people using Yii probably talk more ‘hard code’ than CMS. Still, there’s the off chance that someone will take interest because this stuff is pretty cool.

a) “Rules”. The rules module is a conditional actions/triggers-type module. When an ‘event’ happens, an ‘action’ fires: a causes b. For example: when a user creates a new node, his profile is credited a point; when a user uses a curse word in a forum post, his account is temporarily banned; when a user browses to a node he does not have access to, he is redirected to an error page; etc. Naturally, all scenarios couldn’t be accounted for in the drop-down admin interfaces, so there Drupal has a “Rules API” for those who needed to generate events or fire actions that weren’t already accounted for.

B) “Relations”. The relations module creates a generic relationship between an ‘entity’ and another ‘entity’. An entity can be a file, a user account, a node, or a field. In this way, you can have two content types like ‘Profiles’ and ‘User Images’. Profile’s fields are ‘name’, ‘bio’, and ‘image’. User image’s fields are ‘title’, ‘image file’, and ‘tags’. You can set up a relationship like: “entity A, a profile node’s image field ‘must be’ entity B, a user image node’s image field; only one image may be a profile image…”. As you can imagine, there are innumerable situations where relations can be used. A relationship, in itself, is a node–an organizing node. It can be descriptive. “A is friend to B; B is friend to A; this friendship started at ~; this friendship is golden/silver; …”. Arity is taken into account… It’s a very well thought out module.

c) “Blocks”. The block system goes hand-in-hand with drupal’s theme system. A drupal site has a set of regions, laid out by the theme (for example, ‘left 1’, ‘left 2’, ‘top nav’, ‘top banner’, ‘footer’, ‘broadcast’, ‘content’, ‘right 1’, and ‘right 2’). All content is put into blocks, and the ‘blocks’ structure page allows admins to place the content into one of the regions. Admins can put endless blocks into the regions. The regions are like containers, which can be styled. The blocks are sub-containers, which are styled separately. The only reason this is essential is because of its integration with views.

d) “Views”. Views are a way of organizing content. They work heavily with ‘relations’ using an add-on called ‘contextual filter’–also a module. They also work with pagination, which is part of core, and with taxonomy. In “Views 3”, Chaos Tools is required. I haven’t done much reading on chaos tools, but I assume it’s just a more accessible form of pagination, numbers, dates, etc. Anyway: a view is a way to create a highly-customized, calculated block of content. Some examples of views: a block that displays the 5 most recently logged-in users; a block that displays the 10 least visited on-site nodes; a block that displays 4 random images from the site; etc.

e) “Views slideshow”. Views is so handy that I prefer the almost bug-free “views slideshow” to any of the other crap out there. Automatic jQuery stuff has this nasty habit of spamming through a user’s screen, 7000 images in 2 seconds, if they are in a different tab for an extended period of time. It takes a lot away from the site, IMO. Galleria is like a mini gallery, and in my experience is very poorly organized. “Views gallery” gives the user a lot of control. It just takes a view of images, organized by the criteria of a view, and it allows users to page through the images. I feel like I need a new kind of slideshow extension for every slideshow area on my site, but views slideshow allowed me to easily orchestrate my slideshows. I have yet to find a disappointed admin.

f) “Taxonomy”. Taxonomy is a tagging system. The terms are literally synonymous, anymore. Taxonomy is really cool, though, because it’s hierarchical. Also, the tagging method is pretty sweet: comma-separated. It’s not like the StackOverflow method of hyphenating all the tags. English Grammar is more complex than that. While it’s very unfortunate that it extends the knowledge most programmers have of the English language (I really wish Native English programmers had more respect for natural languages because they’re far less ambiguous than programming languages, in my experience, but only when used properly), hyphenation actually translates a very specific meaning in English. “Taxonomy” doesn’t throw hyphenation in all willy-nilly. In this way, phrasal words can maintain their own, unique meanings from hyphenated words. What’s most excellent about taxonomy is its integration with views, through the contextual filter. Taxonomy can be an ‘entity’, also, so it can be used in relations. Usage example: create a view in region ‘right 1’ that displays 4 ‘teaser images’ from any image-bearing node whose taxonomy matches at least one word on $page_current. As you can imagine, this is a very powerful SEO and user funneling tool. Helps to maintain the user’s interest and keep them moving through your site, taking up lots of info…

There are some other modules worth mention, but this is the ‘short list’. Don’t be bogged down by lapses in comprehension. If you don’t understand something, please just ask. I love chatting.

I came to Yii development after several good years of Drupal development. In recent time, I felt little joy developing for Drupal while I enjoyed developing using clean OO design PHP5 custom code. Now I enjoy doing OO, MVC development on Yii.

The list that I can give differs a lot from the list of modules you gave for Drupal. The reason is that in Drupal you are developing on a CMS, add ready made modules and develop your own. Yii is more fundamental - its a framework, not a working CMS. You can build CMS with it.

I usually found that what works best is forgetting how things are done in Drupal cause at most - they are irrelevant.

Having said that, if you’d like to utilize Yii’s built in RBAC system, I recommend RBAM extension for a nice GUI to manage the ‘auth items’.

I also built during the project I’m working on at the moment, several extension that I found useful for re-use in other projects. Among these:

Last but not least - good luck and welcome aboard!


That’s a pretty good start. Thank you. I’ll see what I can do with these extensions. :)