Fix Images & Media Paths Problem for TomatoCMS 2.0.8 Installation with Sample Data

Tags: |

Based on Zend Framework, jQuery and 960grid, TomatoCMS is a powerful Content Management System. It’s free and open source licensed under GNU GPL. I installed it just yesterday and completed its configurations and fixed its missing images errors today and I’m already liking muchly whatever I’ve seen until now.

There are tons of features in this CMS and and I don’t know how I missed it for so long.. Mind you I have seen and used many CMS, and I have built one of my own from scratch so I have some idea what it takes to build a CMS like this one. So hats off to TomatoCMS Developers for doing it using Zend Framework, jQuery and a CSS framework.

You can easily create, customize the layout of your website through a visual tool called Layout Editor very easily. Layout Editor allows you to not only drag, drop but also configure the widgets as well as preview the layout of the site. TomatoCMS has a lot of built-in widgets, and developers can easily create new widgets.

Zend Framework

TomatoCMS is based on one of high level PHP frameworks. ZF ensures that development follows Model-View-Controller architecture, object oriented design principle.

jQuery

It’s probably that jQuery is most popular javascript library. As its slogan “Write less, do more”, developing scripts in TomatoCMS becomes easier than ever. In addition, you can use many available plugins provided by jQuery and other developers.

960 Grid CSS Framework

TomatoCMS uses 960grid to layout the web pages for both front-end and back-end sections. It’s convenient to customize the layout. You’ll feel more easy to split website into two columns, three columns and four columns.

The premise of the 960grid is ideally suited to rapid prototyping, but it would work equally well when integrated into a production environment. There are printable sketch sheets, design layouts, and a CSS file that have identical measurements.

TomatoCMS Installation: Resolve Missing Media files Issue

There’s a little glitch though, after installing TomatoCMS 2.0.8 with sample data, you will notice that images and other media files are not loading and reason for this problem is that sample images and media paths are set to localhost.

To resolve this, you need to first get the media files and upload them to your upload directory, then run few MySQL commands to update tables for the paths to point to your TomatoCMS environment.

You can download sample images from here.

Unzip, and upload these to the upload directory on your TomatoCMS directory.

After uploading, execute the following queries to update the sample data using phpMyAdmin or any other MySQL client.

Please note that ‘/path/to/cms/’ in the following queries need to be the actual path of your TomatoCMS installation. For Instance, you have setup your TomatoCMS at htp://tomatocms.domain.tld/ and your upload directory is placed at htp://tomatocms.domain.tld/upload/, your ‘/path/to/cms/’ would be blank like this ”. Or you may choose to add absolute path to your installation.

 
   UPDATE ad_banner
    SET image_url = REPLACE(image_url, 'http://localhost/tomatocms/', '/path/to/cms/');
 
    UPDATE menu_item
    SET
    link = REPLACE(link, '/tomatocms/index.php/', '/path/to/cms/');
 
    UPDATE multimedia_file
    SET
    image_square = REPLACE(image_square, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_small = REPLACE(image_small, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_thumbnail = REPLACE(image_thumbnail, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_crop = REPLACE(image_crop, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_medium = REPLACE(image_medium, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_large = REPLACE(image_large, 'http://localhost/tomatocms/', '/path/to/cms/');
 
    UPDATE multimedia_set
    SET
    image_square = REPLACE(image_square, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_small = REPLACE(image_small, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_thumbnail = REPLACE(image_thumbnail, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_crop = REPLACE(image_crop, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_medium = REPLACE(image_medium, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_large = REPLACE(image_large, 'http://localhost/tomatocms/', '/path/to/cms/');
 
    UPDATE news_article
    SET
    image_square = REPLACE(image_square, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_small = REPLACE(image_small, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_thumbnail = REPLACE(image_thumbnail, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_crop = REPLACE(image_crop, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_medium = REPLACE(image_medium, 'http://localhost/tomatocms/', '/path/to/cms/'),
    image_large = REPLACE(image_large, 'http://localhost/tomatocms/', '/path/to/cms/');

Hope that helps.

Cheers!

Related posts:

  1. Moving Media Folder, Updating DB and Fixing Media URLs for the WordPress using Search & Replace Plugin
  2. [Joomla] Resolve Error Installing Joomla Components or Plugins, It was not possible to copy the selected file
  3. How to fix broken Facebook sample application ‘footprints’
  4. [AS3] Loading External Images In Flash CS5 Using the UILoader Component AS3
  5. Resolve Mobile Safari Greyed out File Field Issue in iPhone/iPod/iPad by using Picup App to upload images