Magento Themes and Magento Extensions

Magento : How add translation ability into cms page or static block ?

Share
Posted on May 14th, 2013 | Posted by admin

As we all know magento have multi-language store. Magento use following syntax in .pthml to make text translate to multi-language which is like this :

    <?php   echo $this->__('text to translate'); ?>

OR

    <?php   echo Mage::helper('ModuleName')->__('text to translate');  ?>

But text written in cms page or static block have not translation ability.
To make cms page or static block text compatible with translation ability we need to do some extra coding work which is like this:

We can use following directive in cms page or static block

{{translate text="text to translate"}}

To make it working in cms page or static block we need to add directive function in magneto code as show in following steps.

In Magento, How to display static block in phtml file

Share
Posted on March 23rd, 2013 | Posted by admin

In Magento, you can easily display the different static blocks in each pages. First you need to create static block, for these just Login into site admin end goto CMS->Static Blocks.

Click Add New Block button and fill the required fields and finally save it. Here you need to note the Identifierthat need to be input in below code to display block in individual pages.

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('your_cms_block_identifier')->toHtml() ?>

Magento Use Custom Product Attributes to Add CMS Static Block to Product Page

Share
Posted on November 23rd, 2012 | Posted by admin

The Magento shopping cart has wonderful tools like attributes that makes it easy for users to control custom content on your products. Recently, I have had a client that needs to display the same information over multiple products. So rather than manually adding it on one product, I thought it would be easier to link a custom cms static block to the product page. While this seems like an easy thing to do, Magento makes this a bit complicated to set up. So this tutorial is meant to show you how to do this! After this tutorial you will be able to control static cms blocks from any product in your Magento store.

So let’s begin.
Setting up your Custom Product Attribute.
First we need to set up a custom product attribute correctly in magento. This will let us create a few cms static blocks and link them to our product. First login to your magento backend and go to Catalog > Attribute > Manage Attributes. Once the page reloads click on “Add New Attribute”. This will take you to a page where you can set up your attribute.

How to show products with toolbar and pagination in magento static block

Share
Posted on September 27th, 2012 | Posted by admin

It is common in all Magento sites to show the product list in Home page using CMS feature in admin. Recently i had a requirement to display special products in clearance category. I need to create a static block which calls the custom product list block with special product filtering and include it in a category called clearance.

But in the latest version of  Magneto 1.4 we can’t use XML Layout for static blocks, of course we can use XML Layout in CMS Pages which will include the toolbar and pagination. After doing lot of trial and error i found out a way to show products in static block with toolbar and pagination. The below method will show the product listing with pagination and toolbar in static block.

We can pass the arguments in the block call as shown below.

{{block type=”yourmodule/blockname” name=”product_list” category_id=”6″ column_count=”3″ count=”6″ limit=”4″ mode=”grid” toolbar_block_name=”product_list_toolbar” template=”catalog/product/list.phtml”}}

How to use category to show static pages

Share
Posted on August 18th, 2011 | Posted by admin

Some days ago, I worked on a project which has many URLs linked to static content page. These URLs are shown in main menu. As you know, in main menu are categories. Normally, almost developers add these URLs directly to the phtml file. But I will show you how to do it by another way which is using category .Therefore, you can use each category for one static content page.
First of all, create a static block (instead of static page) by going to CMS > Static Blocks.
After that, going to Catalog > Manage Categories to add new category. To make the category show static block, navigate to ‘Display settings’ tab and select ‘Static block only’ in display mode drop down field.

Page 1 of 212»