Web browser css hacks – firefox, IE, chrome, safri, Opera

Inline Hack for IE
* (star) can be used as the inline hack for both ie6 and ie7.

For Example:
Syntax: .selector{*property:value;}
.logo{*margin-left:10px;}

IE6 browser inline Hack
_ (underscore) can be using only for ie6

For Example:
Syntax: .selector{_property:value;}
.logo{_margin-left:10px;}

Firefox inline style
content:””/*” can be used for firefox only where IE cannot recognize it.

Internal Style
Use * html for ie6 and *+html hack for ie7

For Example:
Synatax: * html .selector{property:value;} , * + html .selector{property:value;}

* html .logo{margin-left:10px;} for ie6
* + html .logo{margin-left:20px;} for ie7

IE7 and Firefox browser Hack
Use html>body hack for ie7 and firefox.

For Example:
Syntax: html>body .selector{property:value;}

html>body .logo{margin-left:10px} will take only in ie7 and firefox

Mordern browser Hack or Firefox Hack
Use html>/**/body {} hack which will support only in both firefox2 and firefox3.

For Example:
Syntax: html>/**/body .selector{property:value;}

html>/**/body .logo{margin-left:10px} will take only in firefox.

Browser hack for Opera versions 9 and below
Use html:first-child {} for opera browser. Also you use
Syntax: @media all and (min-width:0px) {head~body .selector {property:value;}}

For Example:
@media all and (min-width:0px) {head~body .logo {margin-left:10px;}} only for opera

Firefox3 browser hack
Use html>/**/body .selector, x:-moz-any-link, x:default {property:value;} for firfox3 only.

For Example:
Syntax: html>/**/body .pro_yl, x:-moz-any-link, x:default {background:red;}

Google Chrome browser hack
Use body:nth-of-type(1) .elementOrClassName{property:value;} only for google chrome.

For Example:
body:nth-of-type(1) .logo{margin:20px;}

Safari browser hack
Use Syntax: body:first-of-type .elementOrClassName{property:value;}

Fox Example:
body:first-of-type .logo{margin-top:10px;} only for safari.

Fascinating problem with .htaccess and addon domain

Recently I got website project from my client and he was interested to do install the site on addon domain. I installed the site successfully but were not to able to update the website content from admin panel. There was an issue of restriction and/or permission in the root domain’s .htaccess. So I thought I can solve this issue by using overriding the .htaccess file using this code

AllowOverride None

But this was not working for me. Again I thought what will be the issue why this is not working. I finally got the solution for this issue.

Our root .htaccess file were using rewrite rules.

Here’s what worked:
#enable rewrite engine
RewriteEngine on

.htaccess file in addon path (/public_html/cragsem.com/addon.com/) looks like this:

RewriteEngine off

Hope this post will help for others..

Display banners for category page in Magento

Display banners for category page is very easy in magento. This banner will be shown at the top in middle column. It’s very easy functionality provided by magento itself. You just need to know how to do this that all. Lets walk through the set of 2 quick and easy steps. Presuming that you have magento installed along with sample data/ or using default them. If in case the custom theme is installed/ configured then you may need to check the new theme file i.e. view.phtml of category page.

2 quick and easy steps:

Step 1: Create static block.
Login to the magento admin panel and click on “CMS > Static blocks” and create new static block.
Just remember the name of static block here

Step 2: Assign static block to the category.
Once the step 1 is complete go to the “Catalog > Manage Categories”. Select/ Click the category from left menu. It will reload the right hand panel data. Select “Display Settings” tab from right hand panel.
Now change
I) “Display Mode” drop down value “product only” to “static block and prodcut”.
II) Now select the cms block from drop down list of “CMS Block” field and click on save category button.

Now go to front-end and select the category page for whom you have just set the cms block. It will show you banner at the top of product list.

How to move Magento website to another domain in the same server

There’s a few things you need to do once you have your staging domain name all set up.

1. Copy the database. Export it to a file, create a staging database, Open exported database file with any well know editor(like notepad++) and replace current domain “currentdomain.com” to new domain “newdomain.com” and import this dump file.
2. Copy the files to new domain folder. Make sure you clear the var/cache and var/session folders as they’ll have old data that we don’t need.
3. Update the app/etc/local.xml file with your new staging database information. This step is important!
5. Finally, load up the staging domain, and that should about do it!

If you need any help then contact us

Enjoy!!!!

How to set Google Analytics in Magento Store

Google Analytics is a free Google service which allows the webmasters and web site administrators to monitor their web sites’ traffic and conversion ratio.

Magento supports two types of tracking:

1-Page View Tracking: Lists the origin from which your web store visitors linked to your store.

2-E-commerce Tracking: Lists the customers that make purchases and what they buy.

First you need to sign up at http://www.google.com/analytics/sign_up.html. You will receive a Google Analytics account number. Write it down since you will need it for the Magento configuration.

Then configure the Google Analytics tracking in Magento. Open the Magento Admin area and navigate to System->Configuration->Sales->Google API.

Pick the Yes option from the Enable drop-down menu. Enter the Google Analytics account number in the Account number field. Click on the Save Config button.

That’s all.

Enjoy!!

How to do SEO in Magento

Magento supports search engine friendly e-commerce applications.

The Search Engine Optimization for Magento can be enabled through the script admin area -> System -> Configuration -> Web -> Search Engines Optimization

In the URL Options it is recommended to turn off the Add Store Code to Urls function (it is set to No by default).

seo1

Also, Magento installation set the default page title to Magento Commerce. Pick a more descriptive one and change it from the script admin area ->System -> Configuration -> Design -> HTML Head.
Enter the new one in the Default Title field. It will be used for pages without custom title. If you want your store name to appear in all page titles put it in the Title Suffix field.

How to set SSL in Magento

The private SSL certificate is an important upgrade to your website. The basic function of an SSL is to encrypt all communication between the browser and the server, ensuring that all data goes through a secure (HTTPS) connection. An SSL certificate is a necessity when you want to operate an online shop and process the sensitive customers data through your software. It helps you gain your clients’ trust and increase your web site’s search engines rank.

The certificate could be easily enabled through the Magento Admin area -> System -> Configuration -> Web.
There you can define the insecure (non-SSL) and secure (SSL) URLs

In the Base URL fields you should enter the unsecure (regular) web site URL and the web site URL for the SSL connections. You can leave the other values unchanged, as they will be set automatically by the script after you enter the Base URL. Basically the other fields define the URLs of the main Magento store page and the URLs of the skin, media and JavaScript folders. The drop-down menus allow you to enable and disable the SSL support for the web site’s frontend and backend.

Configuring Magento for Development / Debug Mode

1. Disable Cache
System > Cache Management > Select All [check-boxes] > Actions = Disable > Submit

2. Re-Index All
System > Index Management > Select All [check-boxes] > Actions = Reindex Data > Submit

3. Disable Compilation
System > Tools > Compilation > Disable

Note: By default compilation mode is disabled. So just check if the Compiler Status is Enabled or not.

4. Turn on Error Reporting
a> open index.php and un-comment the following line
1

#ini_set(‘display_errors’, 1);

b> open .htaccess and add the following line at the end
1

SetEnv MAGE_IS_DEVELOPER_MODE “true”

5. Turn on Logging
System > Configuration > Advanced > Developer > Log Settings > Enabled => Yes

6. Configuring Mangeto Error Page
rename errors/local.xml.sample to errors/local.xml

7. Install ‘Easy Template Path Hints’
Install Easy Template Path Hints for turning on/off the template path hints for frontend and backend easily & securely.

That’s all. If you are getting any issue,please contact us

How to get skin url,media url,base url and store url in magento

Get Magento URL paths of skin, Media, JS, Base and Store URL in CMS pages. There are different ways to retrieve mentioned URL paths depending on where section you’re editing.

To Retrieve URL path in STATIC BLOCK

To get SKIN URL
{{skin url=’images/sampleimage.jpg ‘}}

To get Media URL
{{media url=’/sampleimage.jpg’}}

To get Store URL
{{store url=’mypage.html’}}

To get Base URL
{{base url=’yourstore/mypage.html’}}

To Retrieve URL path in PHTML
Note: In editing PHTML don’t forget to enclode the following code with PHP tag

Not secure Skin URL
<?php echo $this->getSkinUrl(‘images/sampleimage.jpg’) ?>

Secure Skin URL
<?php echo $this->getSkinUrl(‘images/ sampleimage.gif’, array(‘_secure’=>true)) ?>

Get Current URL
$current_url = Mage::helper(‘core/url’)->getCurrentUrl();

Get Home URL
$home_url = Mage::helper(‘core/url’)->getHomeUrl();

Get Magento Media URL
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

Get Magento Skin URL
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

Get Magento Store URL
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

Get Magento Js URL
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

How to change Magento contacts page into a 1 column layout

The layout for the page is controlled by app/design/frontend/default/YOURTEMPLATE/layout/contacts.xml

Find the code around line 37
<reference name=”root”>
<action method=”setTemplate”><template>page/2columns-left.phtml</template></action>
<action method=”setHeaderTitle” translate=”title” module=”contacts”><title>Contact Us</title>