Adding a file type for syntax highlighting in Dreamweaver

Monday, November 10th, 2008

I’m using a proprietry open source Ecommerce system to complete a project at the moment all it’s file extensions are renamed to *.phtml.  This means I lose syntax highlighting in Dreamweaver, to add a new document type for syntax highlighting you can do the following:

  1. If you’re using a Mac CMD click on the Drewamweaver app, this will open the install directory; if not just navigate to the directory.
  2. Open the file ‘configuration/DocumentTypes/MMDocumentTypes.xml’ file - in Dreamweaver why not.
  3. Pick the syntax highlighting you want, in my case it was PHP so I scrolled down or search for the extension in the XML doc.  In my case PHP was on line 75.
  4. The line will look like

    <documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5" macfileextension="php,php3,php4,php5" file="Default.php" writebyteordermark="false">

    You want to add the extension you want where it says fileextension=”…”. If you’re Mac you can ignore the winfileextension and vice versa if you’re Windows. The new line will look like

    <documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,phtml” macfileextension=”php,php3,php4,php5,phtml” file=”Default.php” writebyteordermark=”false”>

  5. Restart Dreamweaver, and voila.

Posted in:
No Comments »

Expression Engine - Removing index.php

Wednesday, July 16th, 2008

Expression Engine Removing index.php

Expression Engine ships with no URL rewriting, and that means that every page on your expression engine website will be prefixed with index.php.  To remove the .index.php from each page you’ll need to do some URL rewriting.  Expression Engine have some documents detailing how to remove index.php (opens in a new window) on their website, but they don’t cover if you’re hosting your site from a subdirectory (www.mysite.com/subdirectory/expressionengine/)

To remove index.php from your pages, just create a file in the root of your expression engine install called .htaccess.  This will tell Apache how to rewrite the url to remove the offending prefix.  Here’s how to do that: read more…


8 Comments »

jQuery Sortable Lists With Drag Drop Handle

Thursday, April 24th, 2008

jQuery is damned powerful there’s no doubt about it, but it’s a swine to get started with and the documentation was written by nerds for nerds. The shameful thing is, it doesn’t need to be so hard. I’ve recently made use of a drag / drop style list that will remember the order of the list.

If you use the standard jQuery sortable items, you’ll get the two following problems:

  1. You won’t be able to click on any items in the sortable list you have
  2. You’ll probably want an update of the order of the list after every change.

I did find a solution to the problem over at Scott Sauyet’s site, but I needed a little more… The following example will do both, it uses the handle and update options on the .sortable item. By adding these simple items you can produce a pretty advanced sortable list. You could even add AJAX into that update command and automatically update your database with the new values every time you change then removing the need to refresh, and that’s very web 2.0.

  • moveItem 1 with a link to Google
  • moveItem 2
  • moveItem 3
  • moveItem 4Perhaps you want to add a form in here?

    Text:

    And a textarea

read more…


Posted in:
15 Comments »

Java Image Upload With Client Side Resizing

Saturday, March 29th, 2008

JumpLoader ScreenshotI was recently looking for a way to upload large images for the web and automatically create different sizes (small, medium and large.) The only viable way to do it is with Java because it can all be done client side. If you do the work server side, you’ll be uploading a large file then using a lot of processor power to resize it.

I’ve tried a few and the one that came out on top was the JumpLoader it’s good looking, functional and customisable. When uploading several versions of an image at different sizes though it will zip them up (for transfer purposes,) you’ll then have to unzip them - here’s the PHP to do that.

read more…


No Comments »