Convert text to an image with Javascript and HTML5

Hello! Working with frameworks like Django and with CMS’ like Drupal and WordPress we come across a wide variety of requirements for manipulating, sanitizing and importing data from all different sources and formats. Recently we had the requirement to take a text field that was defined in a Django model and convert that text string to an image. There are many reasons for this type of requirement. You could argue that this requirement would be the first (of many) steps towards implementing your own custom captcha solution. Well we did some research and found some solutions out there and implemented it our self in Django and we thought we’d share here as well! I’ll go through each of the components necessary to implement this. This type of implementation can very easily be integrated into WordPress or Drupal through a custom module or custom plugin or function perhaps. Additionally you can […]

Drupal Problem : An AJAX HTTP request terminated abnormally

Hello! Recently we had a tricky problem with Drupal 7 and manipulating content. Our content types and content in general for a particular Drupal site has grown significantly. Ajax queries in Drupal Adding and removing content such as images or gallery items requires an Ajax query that polls the database. These queries, once your database grows on a drupal site, can also grow. You might not notice much of a difference (when its working) but it does require more overhead when manipulating data via Drupal’s administration area. When attempting to add or delete an item within a content type , we received this error : When investigating further, we saw this in the DBLog within Drupal : Why Ajax was returning an error Further investigation provided some evidence of this error. What we found was that many different elements , configuration settings or permissions could be causing these types of […]

Drupal Development : Make a page template for dynamic page requests

Hello! Drupal is a fantastic content management system with an even more fantastic development community. Recently through our own Drupal development projects, we came across a scenario that required the processing of dynamic (i.e. “Wildcard”) page requests to the same drupal page template. If I’ve lost you already , don’t worry! All we are trying to do is ensure the following page request scenarios are served by the same page template : drupal-site.com/page1/randomrequest1 -> page–page1–wildcard.tpl.php drupal-site.com/page1/randomrequest2 -> page–page1–wildcard.tpl.php You can see in the two above scenarios, that the “page1” root request URI is the same, but the subsequent URI requests , “randomrequest1” and “randomrequest2” are different. What happens if you want to use the same page template for both random requests? Easy, you implement a check in the preprocess page hook in template.php! In your drupal theme, you will have a file called template.php. This is where all the pre, […]