Current musing:

Using contenteditable to test css page layouts

This should be obvious, but I just realized that one could use the the HTML5 contenteditable feature to test page layouts. “Contenteditable” is a fancy little tag attribute that allows the user to edit the content contained in the element from the browser.

For example, Read more…

downloads

These guides are free, but if you have found them useful then please consider donating $2. Hey, that's less then the cup of coffee your drinking right?

subscriptions

« Blog home
Modx 2.0 Revolution Cheat Sheet

Many people have found my Modx 1.0 “Evolution” Cheat Sheet very useful.

So I think people will also enjoy the slowly being updated modx 2.0 “Revolution” Cheat Sheet.

Please note that I have not had time to update all of it, so things will be changing as time goes on, but the first page of this cheat sheet is already very useful because it highlights some of the changes to tag formats and a handy list of output filters.

Also please note that you can get excel or open office calc versions of both of the above files by simply changing the output variable in the address line from “output=html” to “output=xls” or “output=ods”.

Please drop me a comment if you have found these useful!


Modx CMS Cheat Sheet

As I work I’ve tried to collect the things I reference most often into a single place. This cheat sheet is an onging result of that effort. It isn’t pretty, but it is handy (for me at least). I hope it helps someone else: Link to full version. Embedded version below:

UPDATE: since people seem to keep having trouble with getting a copy of this here’s a link to an excel version. No promises that it will be kept up-to-date.


MODx: allow users to edit nested pages, not parents.

This tutorial will show you how to allow users to edit only nested pages, without allowing them access to those pages’ parents.

Scenario: You have a site running on MODx and have several users with varying levels of access. One section of your site has the following structure:

Root
|
-->Resources
	|
 	-->Teachers
  		|
 		-->Classroom Notes

You would like to let your teachers edit the “Classroom Notes” page every day with all the things that have happened that day, but you don’t want them to have access to any other page on the site. In fact most of them are so devoid of technical skill you want all the other pages hidden from the tree view when they login so there is no confusion about which page they are supposed to edit.

So in the Security tab of your manager you create a user group called “teachers” and add all the teachers to this group. You next create a document group called “teacher pages” and add the “Classroom Notes” page to it. Every other page goes to a private “admins only” document group. (Use the Doc Manager module under the Modules tab to mass edit pages’ document group associations.) Finally, you link this document group with the “teachers” user group.

But now you have a problem. Log in as a teacher and you won’t be able to access the page. You will won’t be able to see any pages at all! That’s because the parent pages of “Classroom Notes” are private for admins only.

You could make both the “Resources” page and the “Teachers” page part of the “teachers” document group. Then teachers would be able to see and edit the “Classroom Notes” page, but they would also be able to edit the parent pages. This is not a good option, now they can see three pages instead of just the one you want them to edit.

What to do?

Solution: Enter the @DOCUMENT binding

First, create a template variable called [*importPageContent*]. Give it the caption “Import another pages content with @Document ##” and leave the input type as “text”. Be sure to leave the default value blank, and don’t forget to associate this template variable with the template used by the “Classroom Notes” page.

Second, edit the template used by the “Classroom Notes” page. Add your newly created template variable just below the [*#content*] tag.

Next, create a new document under the root of your site. Give this document the title “Classroom Notes Content” and un-check the “show in menu” box. Associate this page with the “teachers” user group and every other page in the site with the “admins only ” group. Take note of this document’s ID.

Finally, edit your original “Classroom Notes” page. Leave the content text box completely empty and instead insert “@DOCUMENT ##” into the importPageContent variable text box, where ## is equal to the document ID of “Classroom Notes Content” page.

There you go, now the “Classroom Notes” page pulls its content from the “Classroom Notes Content” page and your teachers can only ever see and edit this latter page.

Enjoy!


ModxCMS Wiki alive and kick’n

ModxCMS the best gosh darn content management system I’ve ever found just got a lot better. Like most open source projects documentation is sparse. But with the new ModxCMS wiki that should start to change.

Of special importance for current Modx users there is are fantastic upgrade instructions. The latest version of Modx (0.9.5) is a significant improvement.


How to get into MODx when your blocked or lost your password.

This has never *cough* happened to me. But what if you forget your password and block yourself out of your MODx Admin account?

Before we begin, you need to have access to your MODx’s database for any of the below information to be helpful. Hopefully you have a different password (that you do remember) for your database! Many web hosts provide MyPHPAdmin for you to use, and often it is bundled with your server’s control panel. If you can get to it you’re good to go.

How to get past the blocked status:

If you miss type your password more than 4 times you get blocked and have to wait several minutes before the system will let you try again. This can be really annoying if you just have clumsy fingers.

  1. Go to your database and find the table titled “modx_user_attributes”
  2. Find the admin user and edit the following two items:
  1. Set “blockeduntil” to zero (0).
  2. Set failedlogincount to zero (0).
  3. Refresh the login page and type your password properly this time.

How to get in if you have forgot your password:

  1. If you are blocked then follow all the steps above and…
  2. Visit http://md5.benramsey.com/ and type in a new password in the big box labeled “String to convert to an MD5 hash:” Click the “Create…” button at the bottom. Select and copy the resulting string of letters and numbers on the right.
    UPDATE: You can do this in phpMyAdmin directly (or with a mySQL query) See the first comment below.
  3. Go to your MODx database.
  4. Find the table titled “modx_manager_users”.
  5. Find the “password” field and replace its contents with the copied hash code you just created.
  6. Save the changes and return to the login screen and login with your new password.

Bulk document manager: MODx

So I just installed the 0.9.5 beta of MODx, and wanted to play with the bulk document manager I wrote about earlier.

It took me a few minutes to find it, so I thought it worth posting a few instructions for those who want to know where it is.

You will find it under the “Modules” category in the manager.

Once there you will see several things that you can change en masse. The most useful (for me at least) are under the “Other Properties” tab. Here you can change any of the following settings for a range or set of pages that you select.

  • published status
  • hide in menu status
  • searchable status
  • cacheable status
  • use the rich text editor status
  • delete or undelete (this is cool! you can delete or undelete a whole bunch of pages!) Rember you have to acutally empty the trash by clicking the little trash can at the top of the document tree to permanently remove “deleted” pages.

You can also change documents’ publish, unpublish, created on, and edited on dates. Finally you can change documents’ authors.

The other tabs in the document manager are useful, though I think they will be less often used. they allow you to bulk change documents’ templates, template variables, permisions, or menu order.

This last one, the Menu Index Editor deserves special note. By clicking on a document parent (folder) in the menu tree and hitting go you can drag and drop the files underneath it into any order you please. COOL!

All said and done this is, in my opinion the most useful upgrade to MODx. It makes this already great CMS superb.

Blogged with Flock


MODx, the perfect CMS for small web developers.

The small web developer has a unique set of problems to solve when designing websites that are easy for the client (and the developer) to maintain.

Unrealistic client expectations about updating.
Small time clients who appreciate the complexities of the web are rare. Almost every small client says “And it’s really easy for me to update the site myself right?” The honest answer is, of course, “No.”

Let’s face it, no matter what tool you use, publishing to the web is not like using MS Word. Even if it were, how many of your recent clients could use Word well? I thought so. A simple little thing like an extra P or BR tag will throw off spacing, and most WYSIWYG editors aimed at the average user are pretty quirky when it comes to putting in the odd paragraph or break.

Very tight budget.
Sometimes your lucky to have enough $$ to pay for your labor, let alone enough to purchase any software. So open source is the only option and not chosen out of idealism.

Limited time.
You may develop websites part time, or have very short deadlines. You can’t devote weeks to customizing and tweaking a cumbersome system. You need something that is easy to install, easy to template and easy to upgrade.

Enter MODx.

By no means a small time system, it could probably handle a very large business site, and it certainly has a robust enough API to make even the most idealistic customizer happy. But for us little guys, it’s just beautifully simple.

-> It makes sense. Unlike Drupal which practically takes a Ph.D. to understand it’s taxonomy and template system, or Mambo which has a crazy limited Section-category-page organization scheme, MODx simply organizes content by putting pages inside folders. To most computer users this is perfectly intuitive, so there is no learning curve. That makes developers and clients happy!

-> It’s really easy to install and upgrade. Heck I wrote out the steps for both processes in about 15 minutes. (Seriously it’s very easy).

-> The template system is intuitive and robust. You actually can design your templates in your favorite way and then just copy and paste the HTML into MODx.

-> It’s powerful. There is way too much to talk about here. You actually have to try it to believe it.

-> Clients can edit content from the front end using the built in WYSIWYG editor that actually works pretty well.

-> All of it’s features work in ALL of the major browsers on Windows or Mac!

-> It’s free!

In other words it’s the perfect solution for small web developers. You can rapidly develop sites and give your clients a way to (relatively) easily update the site’s content. Check it out.


MODx install/upgrade: the missing manual

I’m a brand spanking new user of MODx, but I’m already convinced that it is the best content managment system ever. (If you’re still using Mambo then you need a swift kick to the head).

But like most open source projects the documentation leaves a little bit to be desired. Specificaly the installation, and especially, upgrade instructions. So here they are, step by step.

Installation

(in all fairness these are pretty clear on the MODx site)

  1. Download the latest version of MODx (.zip format for Windows and Mac)
  2. Unzip the downloaded archive file (generally double clicking will do the trick)
  3. On Linux/Unix create a blank file called “config.inc.php” in the manager/includes/ directory of the folder you just unziped.
  4. Upload the contents of the extracted folder to the directory on your website where you want to run MODx. Usually you will just upload them to your root directory.
  5. Create a MySQL database on your server for your MODx site to use.
  6. Create a database user name and associate it with the database you just created. Don’t forget to write down the user name and password you create! If you need help with this step see my very detailed installation instructions for WordPress, I deatail how to do this in cPanel and phpMyAdmin.
  7. Now fire up your browser and load the index.php file found in the /install/ directory. For example, if you uploaded all the MODx files to the root directory at www.yourDomain.com, you would type www.yourdomain.com/install/index.php.
  8. Follow the online steps.
  9. When you get to the screen that tells you that some directories are not writeable by the server then on Linux/Unix you will need to CHMOD all the indicated files to be writeable (777). This is pretty easy to do with a good FTP program. The WordPress guide linked to above has a detailed explanation of how to do this as well.
  10. Once you’ve got everything running, go back to your FTP program and delete the entire /install/ directory from your server. This prevents people from running this process again and doing a hostile take over of your site.
  11. Finally, on Linux/Unix, change the permissions of your config.inc.php file to read only (CHMOD to 444). This is really important, and will help to prevent your site from being hacked.
  12. That’s it, your done. It’s really not that hard.

Upgrading

To upgrade MODx you follow almost exactly the same steps as above. With one big exception. You do not erase or overwrite the config.inc.php file on your server. Here are the steps.

  1. If you have modified any of the default snippets or plugins then either rename them in the resource manager or be sure to uncheck them when you get to the step in the installation wizard that asks you which snippets and plugins to install. The upgrade process overwrites all the default snippets to make sure you have the latest versions. (It is very common to modify the DropMenu snippet so don’t forget this step!)
  2. Backup everything. Backup all your files and your database. Just download all the files with your FTP program to your hard drive and using phpMyAdmin, or whatever you have, “dump” your entire databse to your hard drive.
  3. I’m not kidding around here folks. Backup everything!
  4. Download and unzip the newer version of MODx.
  5. Upload the contents of the extracted folder to your server. Simply overwrite all the old files except the config.inc.php file in your /manager/includes/ directory, leave that file alone. (Did you remember to backup all these files?)
  6. Now fire up your browser and load the index.php file found in the /install/ directory.
  7. Follow the online steps. This time, right after you accept the license agreement, be sure to select the “Upgrade” radio button.
  8. You may have to CHMOD a few files to make them writeable by the server, but the upgrade wizard will tell you if you need to.
  9. Once things are up and running again you can go back and clean up your plugin and snippet names if you changed anything in step 1.
  10. Don’t forget to delete the /install/ directory.
  11. That’s it, your done. You’ve just upgraded MODx.