Tagged template

Get Vim syntax highlighting in CakePHP template files

If you use Vim to edit your php files, you’ve probably got some sort of default syntax highlighting for those files that’s helpful in debugging code. Of course, if you use CakePHP, Vim won’t see your .ctp template files as the php/html combination they really are, and you’ll just see plain text. To fix this, you can add the following line into your .vimrc file (usually located in the root of your home directory):

[cc lang=”vim”]autocmd BufRead,BufNewFile *.ctp set filetype=php[/cc]

When you launch Vim, it will now interpret your ctp files as if they were php (which they pretty much are), and you’ll be able to get the same colors and syntax highlighting.

WordPress Widgets now available for download

The WordPress development team announced the release of the new Widgets feature today. The idea behind these Widgets is apparently that they allow you to edit your blog’s formatting and design (in this case the sidebar) through a GUI, eliminating the need for coding knowledge. Although I’m a bit afraid that, like the WYSIWYG editor which made its way into WordPress 2.0, the new Widgets might prove more cumbersome than helpful, I also think it’s important to look at the big picture of blogging as it exists today. There are hundreds of thousands of people out there with excellent blog content and the crappiest looking template imaginable, because they lack the knowledge to edit the source code directly. This tool will help them incorporate the little additions and gadgets that make the blogging experience enjoyable for the reader, without forcing them to spend countless hours debugging changes on multiple browsers and multiple OS’s. Additionally, since WordPress claims that writing Widgets should be as easy as writing plugins, the open source world should soon be contributing a plethora of them to match the output of plugins that we currently see. I know that it’s popular to hate things like this within the IT community, where obscure wisdom is prized as a status symbol, and the general attitude is ‘if you can’t do it the hard way, you’re not worthy of doing it at all,’ but if Widgets can help expand the two-way communication that thrives on blogs, more power to ’em.