Currently Browsing: Tutorials

Adding CMS Static Blocks to Magento Page Layouts

This will be short, but as you know phtml template files in Magento are stitched together using layout XML files. Sometimes we might have the need to include a static block we have created in the backend to one of they layout XML files. Here is the XML snip one would use to evoke the backend static block in a XML layout file. <block type="cms/block" name="YOUR CMS BLOCK IDENTIFIER"> ...

read more

How to Get Magento’s Email To A Friend URL

In the context of ever needing to get the “send an email to friend” url / link mark up from Magento in other scopes other than view.phtml (say a custom pthml file with layout specific needs that can be configured), here is what you do. First we need to get our helpers / model / product like so: <?php $_product = Mage::registry('current_product'); $_helper =...

read more

Remove Page Headings Per-page in Magento

Under either categories or CMS page’s design tab, include this XML command to remove the page title: <remove name="page_content_heading" /> This can be useful if you wish to have, say a page use the empty layout in the design tab, with no page title to be displayed.

read more

Remove Page Breadcrumbs Per-page in Magento

Under either categories or CMS page’s design tab, include this XML command to remove the page’s breadcrumbs: <remove name="breadcrumbs" /> This can be useful if you wish to have, say a page use the empty layout in the design tab, with no breadcrumbs to display.

read more

Optimizing Window Resize and Mouse Move Events

Today, we will talk about the re-size and mouse move events. These two events indeed are very helpful, but can also be very costly on your site or web app. Let’s take a look at an example of re-size for say window: Vanilla JS versionwindow.addEventListener('resize', function(){ ... logic .... });jQuery version$(window).on('resize', function(){ ... logic ... });Standard...

read more

Using Google Earth Borders as Google Maps Polygons

Today we are going to cover how to extract the polygonal data from Google Earth’s country borders and encode the data into a JavaScript array that we can use in Google maps. With the combination of both polygon borders and Google style wizard you can get some stunning map results. [View Working Example Here] To begin, download and install Google earth here. Once you have installed Google earth, open...

read more

Efficient Event Targeting with JS

Today I would like to talk a bit about setting up events on DOM using jQuery and how one should try to avoid setting up huge numbers of unnecessary events on a single document.

read more

Custom Google Maps Marker Icons With Numbers Using PHP GD

Today we are going to learn how to use PHP GD to build a PHP server side script that can accept a local or even remote file, then bake any text we would like into the image and return it back to us as a .png. This is great for when you have the need to use custom marker icons in say Google Maps, but also would like to have numbers on the markers as well.

read more