One of the things I like about Mephisto is the asset management. Especially the way how you insert image URLs by dragging thumbnail from sidebar to content area. Frog CMS lacked easy way for inserting images (or any other files). Obvious thing to do was implement Mephisto style asset management as a plugin.

It is not one to one copy on how Mephisto does it. Instead of tagging assets you can categorize them by uploading to different folders. There is also extra pulldown to select which assets to show in sidebar while editing.

Plugin depends on Image Resize and jQuery plugins to work. Full installation instructions on project page.

Send Emails from Frog CMS

November 28th, 2008

I needed a mailer backend which can handle complicated forms with any number of arbitary form fields. I also needed to be able to fully control the layout of sent emails. Something similar as oldie but goldie cgiemail.

Here comes Email Template plugin for Frog CMS.

It provides new page type called named Email template. You can POST your forms to this page type. Page contains the layout of the mail including the headers. Template then parses POST:ed data and sends the email.

To: Somebody <somebody@example.com>
From: <?php print $_POST['name'] ?> <<?php print $_POST['email'] ?>>
Subject: Frog Mail

1. Contact info

Name.............: <?php print $_POST['name'] ?> 
Company..........: <?php print $_POST['company'] ?> 
Email............: <?php print $_POST['email'] ?> 

2. Message

<?php print $_POST['message'] ?>

--
Sent by <?php print $_SERVER['REMOTE_ADDR'] ?>

Plugin assumes your PHP mail() function works properly. Currently it only supports plain text emails. Download and installation instructions at the project page. All feedback welcome.

Ultrafast Frog With Funky Cache

November 21st, 2008

Funky caching is technique popularized by PHP.net site. It was first mentioned by Rasmus Lerdorf in 2002 PHPCon slides (page 25). Content is cached as static file on the first access. All following requests are served using the cached static file. Editing a page will automatically expire cached files. Page is then re-cached on the next hit.

Frog CMS is PHP port of Rails based Radiant CMS. Radiant is great but there is always the hosting problem. Even with mod_rails existing it is still easier to get quality PHP hosting. Both Frog and Radiant are the only CMS’es I can say I like. Expression Engine I can live with. Edicy looks really promising. Everything else I rather not touch.

Read the rest of this entry

Static Maps API has URL length limit of around 2048 characters. You can hit this limit quickly when adding lot of markers. You can keep URL short by clustering markers together.

Square Based Clustering

Clustering is usually done by dividing map to squares. Square size depends on map zoom level. Markers inside a square are then grouped into cluster. This technique has some limitations. Look at the following image.

Two markers are close to each other. In fact they are so close they are overlapping. Both markers are also the only marker inside their square. Because markers are in separate square they wont be clustered.

Read the rest of this entry

Most of the code from previous Static Maps experiments is now put into one clean package. Previously I showed you how to work with markers and bounds. Now we go forward and add zoom and pan controls. It takes only few lines of code. If you just started reading the series check the theory how it works. As a bonus lets add infowindows / bubbles too.

Note! Image above is just a screenshot. You can test final result in the demo.

Create Map and Some Markers

Start by creating new map object and set the size. We also need to give our API key. Markers are positioned on map using location object. Location can be latitude and longitude represented by Google_Maps_Coordinate object. Location can also be map x and y represented by Google_Maps_Point object.

Read the rest of this entry

Simple Static Maps With PHP

October 10th, 2008

Lately I have been playing with Google Static Maps API a lot. Writing the same things again and again is tedious job. I decided to put the code together as one clean extendable package. Writing object oriented interface for generating URL is trivial. Real meat is having working zoom and pan controls on static map with just 9 lines of code (demo now includes also clickable markers and infowindows).

Code is still alpha quality. API might change any time. But here is a quick walkthrough of current features. We will build the map you see above step by step.

Read the rest of this entry

I made quick fix to Mephisto Sitemap plugin. Now it works with lates Mephisto 0.8 (Drax). All old plugins got broken when Mephisto changed to Rails Engines based plugin system.

Install by issuing the following command in your Mephisto root.

script/plugin install 
http://svn.appelsiini.net/svn/rails/plugins/mephisto_sitemap/

After installing remember to restart you WEBrick or Mongrel.

I have been running my own hardware since early 90’s. Hardware has always been produced by Sun Microsystems. Yes, I am a Sun fanboy. Times change and I am forced to retire my old hardware. So I went for shopping for decent VPS. Tried Media Temple first. Gandi was still invitation only. In the end chose Slicehost. Here are the reasons why.

Download Speed to Europe

I do have a small problem with having my hosting physically located in Northern America. I was worried of getting low download speed to Europe. I tested this from several hosts located in Finland and Estonia. Slicehost was always faster than Media Temple.

Read the rest of this entry

Golden Hammer 2008

September 23rd, 2008

Today I arrived to sunny Riga to attend 9th Golden Hammer festival. I was invited to be Head of Digital Media Jury. Something I am really looking forward to.

As usual organization of all things has been top notch. Baltic people are absolutely great at organizing events. If any of you readers are here this week drop me a line or tweet. On thursday there will be BadAd party which is definitely worth visiting too.

Between Hosts

September 19th, 2008

I am in process of moving to a new host. If you see this you read content from the new server. Some things (especially WTF-8) might be broken. Would be great if you leave a comment when you find a broken demo or page.

Note! Code shown is now included in Simple Static Maps PHP class. This blog entry is still good for understanding how it was done. Demo code can be considered deprecated.

Previously I showed you how to make a Google Static Map with clickable markers. Several people emailed me to ask how to show infowindow (or infobubble) when marker is clicked. Technique I explain below still needs JavaScript. It is used to open the infowindow. I use jQuery library in the examples.

Image above is just a screenshot. There is a separate page for working demo. Full source code is also available.

Infowindow HTML

First thing we need is HTML code for the infowindow. I wanted it look exactly the same as in Google Maps. I opened a random map and copied the HTML using FireBug inspect console.

Read the rest of this entry

Latest custom input for Jeditable uses jWYSIWYG editor by Juan M Martínez. This code has been almost ready for a while. This week I finally had time to fix some outstanding FireFox bugs.

If you are interested in writing your own Jeditable custom inputs read the introduction. You might also be interested in MarkItUp! custom input which is similar to jWYSIWYG input.

To test see the working demo and then download the source.

Usage

First include all needed JavaScript and CSS in your HTML.

<script src="jquery.js"" type="text/javascript"></script>
<script src="jquery.wysiwyg.js" type="text/javascript"></script>
<script src="jquery.jeditable.js" type="text/javascript"></script>
<script src="jquery.jeditable.wysiwyg.js" type="text/javascript"></script>
<link rel="stylesheet" href="jquery.wysiwyg.css" type="text/css">

Now you can use input type wysiwyg. Set onblur to ignore. Otherwise clicking menubar will cause editing to quit. You should also include atleast submit and cancel parameters. All jWYSIWYG settings can be passed using wysiwyg parameter. Check documentation from Juan’s webpage.

$('.editable').editable('http://www.example.com/save.php', { 
    type      : 'wysiwyg',
    onblur    : 'ignore',
    submit    : 'OK',
    cancel    : 'Cancel',
    wysiwyg   : { controls : { separator04         : { visible : true },
                               insertOrderedList   : { visible : true },
                               insertUnorderedList : { visible : true }
                }
    }
});

I tested the code with IE6, IE7, FF2, Safari and Chrome. In case you find any problems drop me a line.

PUT Support for Jeditable

September 3rd, 2008

Until now Jeditable only supported submitting edited data using POST method. This was against REST principles. POST should be used for creating new objects. PUT should be used for updating existing objects.

Most browsers do not natively support PUT method. Jeditable does it Rails way by using POST method but submitting additional variable called _method with value put.

Jeditable now has basic unit tests covering most configuration parameters. If you find any failing tests drop me a line. Download latest as source, minified or packed.

Changes Since 1.6.0

Submit method can now be POST (default) or PUT.

$(".editable").editable("http://www.example.com/save.php", { 
    method : "PUT" 
});

Bug where form was submitting twice if using code like below was fixed. Thanks to Hannes Tydén of soundcloud.com for patch.

$(".editable").editable("http://www.example.com/save.php", { 
    settings.submit : '<button type="submit">Save</button>'
});

Note that code below generates exactly the same HTML as code above.

$(".editable").editable("http://www.example.com/save.php", { 
    settings.submit : 'Save'
});
 

Misko Iho Website

August 26th, 2008

Small sideproject we just finished with Magnus. My good friend Misko Iho is starting his own company. He directs music videos and television commercials. Site is kept as simple as possible. Let the content speak for itself.

E!Usability Seminar in Tallinn

August 11th, 2008

Altex Marketing has organized several online marketing seminars. Next one will be held 14. august 2008 at Uniquestay Hotel. Event starts at 14:00 and ends around 17:00. This event will concentrate on usability. Thus the name E!usability.

Tickets cost 1750 EEK (approximately 110 EUR). All previous events have been worth of the money. I believe this one wont be and exception either.

Speaker lineup

  • Kristjan Jansen, freelance interaction designer and web activist, “User and convenience”. Read his blog.
  • Hegle Sarapuu, Trinidad Consulting, “Learn to know your user”.
  • Mihkel Jäätma, Realeyes, “Eyetracking in webdesign, why and how?”.
  • Aivar Paalberg, Enter and Martin Salo, Laborint, “How to gain profit from usability analysis”.
  • Epp-Kristiina Keerov and Carol Tikerperi, Altex Marketing, “Morae software demo”.

Related entries: E!UK – Six UK Digital Marketing Specialists in Tallinn, Eturundus! 8 – This Time at KUMU, Eturundus! 6 – The Big Picture, Eturundus! 4 by Altex Marketing, Notes From Eturundus! 3 – Rok Hrastnik