Using rwd

Hi, I am trying without any success to add details from a product attribute to a CMS page. Basically I want to be able to select a product (say via its id number) and the display a selected attribute from that product (say short description) and then display it in a CMS page along with what ever else is on that page. I have seen lots of ways to create and add categories such as “featured Products” but none for a individual product. The products are all simple and not configurable etc. if that makes a difference?

Any ideas on how I can achieve this? Many Thanks

1 Answer 1


here is the short version.
Create a template file like this.


$id = $this->getProductId();
$attribute = $this->getProductAttribute();
if ($id && $attribute) {
   $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId())->load($id);
    if ($product) {
        $attributeRawValue = $product->getData($attribute);
        $attributeValue = $this->helper('catalog/output')->productAttribute($product, $attributeRawValue, $attribute)
    else {
        $attributeValue = '';
echo $attributeValue;

Now you should be able to use this template inside a cms page like this.
Add this to the content of the cms page:

{{block type="core/template" template="cms/product_attribute.phtml" product_id="YOUR PRODUCT ID HERE" product_attribute="YOUR PRODUCT ATTRIBUTE CODE HERE"}}

This is the quick and dirty way of doing it. IN theory you should not use load in templates. All your logic should go in a block. But in order to have a block class you need to create a module and that take more time and more code.

I haven't tested the code so watch out for syntax errors.

  • Thanks Marius, but i cant get it to work. No errors it just dosnt dispaly anything in that area of the CMS Page i have put it. Not sure what to look for or what i may have done wrong..
    – perpixon
    Dec 5, 2014 at 16:36
  • Make sure that you added a custom template "product_attribute.phtml" in your theme.
    – Ahsan
    Aug 21, 2021 at 7:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.