Preventing a page from being cached in browser

There are times when we require that a page always get served from the server and not from the browser cache. We can use the HMTL following “META” tags to acheive this.

<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">

Continue reading »

IE7 issues with jQuery removeAttr method

I had used jQuery('#id').attr('readOnly', 'readOnly') set the readonly property of text box and used jQuery('#id').removeAttr('readOnly') to make the text box again but then found that "removeAttr" did not work in IE7, the textbox was still not editable.

Continue reading »

Excerpt/Discussion box not visible

You  try to add a new post and want to add a manually crafted excerpt but you do not see the excerpt box, there is no need to worry.  On the Add new post screen click on the “Screen Options” link at the top right side besides the “Help” link below the welcome greeting.

Continue reading »

Installing Magento with sample database

Magento

If you are going to use Magento for the first time then its good to install it with sample database to test it. Here are the steps to install it with sample database.

Step 1: Download Magento zip from  http://www.magentocommerce.com/download.

Step 2: Download sample data zip from http://www.magentocommerce.com/download.  It contains a sql file named magento_sample_data_for_1.6.1.0 and a media folder.

Step 3: Upload the Magento zip to your server and unzip it.

Step 4: Change the permissions of the following folders so that they are writable by the web server.

/app/etc
/var
/media

Using permission 755 will work, in case it does not work use the permission 777.

Step 5: Upload the Sample data zip to your server and unzip it.
 

Continue reading »

500 errors with Magento installation/upgrade

I was installing Magento, unzipped the files to a folder and accessed the URL but instead of getting the installation wizard I got 500 error. After much research I found that the issue was due to file permissions.

Continue reading »

Magento check if the current page is home page

The following code is used to check if the current page is homepage

<?php

if ( Mage::getSingleton('cms/page')->getIdentifier() == 'home' && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' ) :
?>

//Do something here

<?php

endif;

?>

Continue reading »

Magento check if the current page is a category page or not

We can use the following code to check if we are on a category page or not

<?php  if (Mage::registry('current_category')) : ?>
//Do something here
<?php  endif; ?>

Continue reading »

Back to top