June 2010 Archives
Evo FTW!
Coffee, Kettle chips, and Evelyn Lin (NSFW). Those are just a few of the inside jokes that make the office so incredibly fun (and I’m not just being paid to say that!). All jokes and fun aside, learning MODx has been an incredible experience.
I remember back in January, when I first joined the team, I was still unaware of any CMSes. I had learned to code HTML and CSS, and then tried to read up on bits and pieces of PHP. I’m a good learner, but I’ve never had someone who’s had the patience of personally teaching me how to do it.
And then I built my first MODx site on Evolution. Instantly, I understood the concept. What was there not to get? That should be the pagetitle? Replace it with [*pagetitle*]! You need to use another field in there? Replace it! Essentially, it was a search and replace game. Just replace everything that needed to be dynamic, and you had your original website again. Converting frontend code to a CMS was just that easy. With that, I fell in love.
This past weekend, someone made a prop bet with me. We had received a project with a client who’s from a design firm. They had already provided a “website” (I use that term loosely, because if you had seen the source code, you would’ve cried out in horror too). So the prop bet was this: build a website in a workday, and I would get a packet of Kettle chips (salt+pepper is absolutely money. Don’t let anyone tell you otherwise). Eventually, I managed to get the deal to doing it on a weekend, while getting 2 personal days in return. We shook.
So with the difficulty level only ever rising to finding hex color codes, I pretty much re-frontend coded the site, while at the same time, adding in placeholders. I woke up at 4pm. Made myself some pasta. Sat down at 5pm, and started coding. No distractions, no meetings, just a perfect work environment. I finished the whole thing by midnight.
It was amazingly fun. Beating the deadline. Being able to consolidate my knowledge of MODx without having to look up anything in the documentation. I was already well-versed, knew exactly where to start, and what my direction was. I built a website on my very own, without any questions asked. (I even had time to insert all the content too.)
Granted, it’s taken me 5 months to get to this stage, with many people supporting me along the way, being patient with me, teaching me all that I needed to know. I’m a naturally curious person, and it’s helped me learn so much. I know we've been getting a lot of rep for building out Revo sites, but in all honesty, the simplicity of Evo gets so much done. (Earlier today, James accidentally wrote out [ [+session.lang ]] on an Evo site, and I had to remind him that he was back in Evo.)
- Eve Lin
PS - Some day I’ll gush over my love for keyboard shortcuts, Reddit, Mac apps, multi-finger swipes, bacon, funny comments in source code, our inappropriate jokes, web_assets, and my hatred for screencasts.
- Friday, 25 June 2010
- 0 comments
Dynamic Right Column setup in MODx Revolution
We’re building out a large scale bilingual portal using MODx revolution (due to launch in 10 days), and because of the range of different content the site has, we’ve had to create a kind of ‘sub-templating’ strategy for our templates.
The idea is to keep the number of site templates in check - too many templates always leads to a maintenance nightmare - for us as the developers as well as the end user CMS admins.
In this particular site, we have a 3 column layout that goes as follows:
- Left sub-navigation
- Content area with resource specific content for an article, or if it is a folder, then a list of recently edited articles inside that folder.
- Right column with varying content, depending on the section of the site that you are viewing. For example, when viewing a page within the alcohol & spirits section of the site, the right column should feature a top 10 list of wines and a top 10 list of champagne. Those top 10 lists aren’t used in other sections of the site. In some scenarios, we may also want to override the content of the right column for one single page.

So we need to give CMS admins the ability to choose what sits inside the right column, and in what order it should be showing.
Internally we decided to name the right column blocks as ‘widgets’. We decided that we would be able to build everything we needed with only two templates - one for article folders, and one for articles themselves. Both templates have been assigned three template variables, where each one is intended to load a widget in the right column.
We’ve also created a category in the chunks tree that will contain all available site widgets. If we need new widgets later on, they will be inserted inside this category and will become available for selection for CMS admins.

^ How we’ve organized the elements tree.
We’ve previously used categories for organisational purposes only - but in this case there’s actual functional use (see @SELECT binding below).
The three right widgets template variables have been setup as ‘single select dropdown lists’ where options are drawn dynamically from the right widgets chunks category using an @SELECT binding:
@SELECT name FROM modx_site_htmlsnippets WHERE category = 7
The default value of the TV has been set to @INHERIT, meaning that the choice of right column widgets will cascade down the resource tree, unless a CMS admin decides that they wish to override the configuration for any single resource.
So now that we have assigned those TVs to our two templates, here’s how it renders on the resource edit page:

Lastly, to actually render the widgets inside the right column, we have this block of code inside the template:
<div id=”ls-right-col”>
</div>
The MODx parser will evaluate each of those tags as follows (in the example that Top 10 Wines has been chosen):
- Contents of the Top 10 Wines chunk, which can contain any content you like.
More to come on this new portal soon =)
- Wednesday, 23 June 2010
- 0 comments
You know it’s time to change hosting companies when…
Recently, we’ve been planning on consolidating the various hosting plans that we’ve collected onto a single (new) server, but as is often the case in this industry, it’s difficult to find time for these in-house things. This month, we’ve had a lot of trouble with one of our providers, who happen to be hosting the main bulk of our DNS records. After the 3rd instance this week of the DNS being down (not to mention the entire server being down for 48 hours a couple of weeks ago), we made the decision to go through with the migration ASAP when we received this, very enlightening response to our support ticket.
Support Ticket #1940 has been updated
Description:
Hello,
Please check now.
Thanks
So, I’ve spent the last few days setting up a shiny new cloud server to host all of our projects. Once set up, the only major issue was the lack of fancy control panel to manage the virtual hosts. While this may suit the developers down to the ground, our interns and office staff, who often get the pleasure of this grunt work, would struggle with the Linux CLI. After exploring the existing options and being unable to find anything suitable we decided to build one.
I started by setting up a basic control panel that would store these sites and the full virtual host entries, based on a template, in a MySQL database. I then wrote a PHP CLI script to pull the entry from MySQL, and if necessary create a vhost file and the document root/log directories. I modified Apache’s init script to call my PHP script on start/reload. Perfect!
Next, came the issue of being able to reload Apache’s configuration after adding one of these sites. I created another script that would reload Apache if a certain file existed (created by my control panel), then delete it. Finally, I set up a cron job to run this check every minute.

…Just like a bought one.
- Jude.
- Wednesday, 16 June 2010
- 0 comments
New Blog Coming Soon
I can't resist showing some kind of teaser - following in the footsteps of Jason & Shaun, we're in the middle of building out our shiny new (MODx Revolution powered) blog to showcase some of the more technical & intimate details of what goes on here.
We're planning to start by blogging about building the blog itself - as well as the basics, it's going to have a couple of 'experimental' cool features and we've given ourselves an excuse to build 3PC's, custom TV input types and custom TV output types.
Looking forward to launching it after we've skinned it =)

^ Wireframes for the blog - to be passed onto our designers.

^ Backend in development...
The first thing that struck me was how many *good* packages are already available for MODx in a short space of time since we started building sites in Revolution (most coming out of Shaun McCormick's underground lab). You can build a blog very very easily now using a few core snippets and even through drag and drop from the elements tree.
Adding special touches isn't hard either - I installed Shaun's Gallery package and was amazed when I turned on the gallerific plugin, dragged the Gallery element into a document and it just worked - even without adding my own css.
- Monday, 14 June 2010
- 0 comments
How is this possible?
RT @splittingred: New: SimpleSearch, a simple search Extra for #modx #revolution http://bit.ly/dAnSub
I heard from Jason and Ryan that Shaun is known for pumping out quality code in a 10th of the time a normal human being would be - now I'm starting to see they weren't lying as this stream of amazing packages keeps coming and coming.
I have no idea how he keeps this up but it's amazing to watch...
- Monday, 14 June 2010
- 0 comments
How To Create a New User
-
First we need to create the user:
-
-
-
Now that the user has been created we will now need to set the user permissions for the user:
-
-
-
Remember to be careful when setting user permissions. For example Administrators will be able to edit the whole of your site.
-
-
-
- Friday, 11 June 2010
- 0 comments
How To Reset Your Password
-
-
- You'll now receive an email with instructions on how to reset your password.
- Thursday, 10 June 2010
- 0 comments
How To Change Your Password
-
If you don't know your password follow the "How to Reset Your Password" how to here. If you are logged in change your password through your profile:
-
- Thursday, 10 June 2010
- 0 comments
