Monthly Archives: May 2011

Add Javascript to a Concrete5 template the right way

jQuery is included by default in Concrete5. Here’s how to add your own script: Put your .js file in the /js directory in the root of your Concrete5 install. In your theme’s elements/header.php file, add the following just before <?php Loader::element(‘header_required’); ?>: <?php $html = Loader::helper(‘html’); $this->addHeaderItem($html->javascript(‘my_script.js’)); ?> If you want to include your javascript [...]

Posted in Musings | 2 Comments

We’re getting the band back together!

I met my wife 5 years ago at the beginning of a run of the Sondheim musical Assassins at ART here in Portland. I played John Hinckley, Jr., the guy who shot Reagan in ’81. It was an amazing show, and not just because I met the love of my life. The show itself is [...]

Posted in Musings | Tagged | Leave a comment

Clever checkbox handling with PHP

An unchecked checkbox returns nothing when a form is submitted, but most of the time you want it to return something, so you can work with that $_POST variable. This is easy with the addition of a hidden input with the same name as your checkbox: <?php     // If the box was checked, keep it [...]

Posted in Musings | 1 Comment