Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Filtered/Layered Product List from CMS Page
 
Ossy
Jr. Member
 
Total Posts:  20
Joined:  2008-10-22
London
 


From an CMS Page I would like to display a List of Products filtered by an Attribute (e.g. brand).

I can easily display a list of products within a CMS Page, but I cannot find an existing way of specifying a filter based on the value of an attribute.

In the CMS Page I enter:

{{block type="catalog/product_list" template="catalog/product/list.phtml"}}

and in the cms.xml page I add the <reference name="left"> section to display the Layered Navigation:
<cms_page>
         <
reference name="left">
                   <
remove name="catalog.leftnavig" />
             <
block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
        </
reference>
       
        <
reference name="content">
            <
block type="cms/page" name="cms_page"/>
        </
reference>
    </
cms_page>


Is there a way to pass an attribute that would work as a filter? For instance
{{block type="catalog/product_list" brand_filter="123" template="catalog/product/list.phtml"}}
to get the equivalent of http://www.site.com/categoryname?brand=123

Many thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ethan Hunt
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2009-02-05
 

You can add the category_id="123" tag within the block like:
{{block type="catalog/product_list" category_id="123" template="catalog/product/list.phtml"}}
but this will only show products under the category with id 123
Not Sure for attributes? Also looking for the same solution

 
Magento Community Magento Community
Magento Community
Magento Community
 
brendanb
Mentor
 
Total Posts:  1093
Joined:  2008-07-16
London, United Kingdom
 

hi,

did you find a solution to this?

regards
brendan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ossy
Jr. Member
 
Total Posts:  20
Joined:  2008-10-22
London
 

I did not manage to find good solution.

For the time being this is what I do for creating Brand pages with related products and the Layered Navigation:

1) in the brand CMS page I use the following, as explained in my original post:

{{block type="catalog/product_list" template="catalog/product/list.phtml"}}

2) the links to the brand page have the attribute+value parameter into it. For instance:

http://www.site.com/brand-name?brand=123

What the does is to apply the filter “brand=123” into the product list call (1) that selects all the products in the site.

In fact, if you call http://www.site.com/brand-name without the parameter it will show ALL the products.

In order to implement (2) easily, I had an Admin Brand module developed so that it links a CMS page to a Brand, so it knows how to build the links to the Brand CMS pages etc… I hope it makes sense.

It does all I need well and use all the useful features of a CMS page, such as Meta Data. However, the links have a parameter in it, which is not ideal, but not a big issue either.

Alternatively there is a Magento Extension to help woth brands: http://www.magentocommerce.com/extension/1289/shop-by-brands

I am not sure whether it deals with the issue of displaying a full Layered Navigation. Here is an example, but it only shows the Categories: http://www.shearup.com/brands/avena/ It could be that this site only uses the categories in the Layered Navigation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
todoslot
Jr. Member
 
Total Posts:  3
Joined:  2009-08-27
 

For someone who wants to add a complete brand options;

-First, create an image and link to brands in product page:
http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/how_to_add_a_brand_or_manufacturer_logo_to_your_product_pages

-Then, create a cms page with a product list, not only from category, but using an attribute: 
http://yoast.com/landing-pages-module-magento/
Using layered navigation:
http://www.sonassi.com/knowledge-base/magento-kb/yoast-landing-pages-module-with-layered-navigation/

You can see it in http://www.todoslot.es

 
Magento Community Magento Community
Magento Community
Magento Community
 
pradeep_kumar67
Sr. Member
 
Avatar
Total Posts:  160
Joined:  2010-06-24
Bangalore
 

Hi guys

check this post
http://www.magentocommerce.com/boards/viewthread/308574/
i hope it helps you

 
Magento Community Magento Community
Magento Community
Magento Community
 
Amasty
Mentor
 
Avatar
Total Posts:  3988
Joined:  2009-11-10
 

Try using Landing Pages Extension.

Good landing pages give you better sales conversion and pages with unique content, which improve your site rankings in search engines. The module lets you decide which content to display on the pages - selected products, banners, text info, CMS blocks. You can specify custom meta tags and short SEO url for each landing page.
-Improve your site SEO to rank higher in search engines
-Landing pages with nice SEO urls and custom meta tags
-Create pages for NEW products
-Pages based on categories and product attributes
-ON SALE products with layered navigation

For userguide and live demo please follow the link http://amasty.com/landing-pages.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
mauricioprado00
Member
 
Avatar
Total Posts:  63
Joined:  2009-03-11
Argentina
 

I have found a quite easy workaroud, just create this block in your module:

class Intellimage_Better_Block_RequestChange extends Mage_Core_Block_Abstract
{
    
/**
     * Render block HTML
     *
     * @return string
     */
    
protected function _toHtml()
    
{
        
return '';
    
}
    
    
public function setRequest($variable$value)
    
{
        Mage
::app()->getRequest()->setParam($variable$value);
    
}
}

ater that just add this into your cms page on the “design” section:

<reference name="left">
             <
block type="better/requestChange" name="requestChange">
                    <
action method="setRequest"><name>price</name><value>-1000</value></action>
             </
block>
             <
block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="page/null.phtml"/>
        </
reference>

notice that the RequestChange block must be first than the layer_view block. And also the layer_view block is pointint to a file that should be empty, unless you want to show the layered navigation in which case you should use the template “catalog/layer/view.phtml”.

With this technique you will be able to filter by whatever attribute that is filtrable, just put the attribute name and filter value there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cooper
Sr. Member
 
Total Posts:  104
Joined:  2008-03-31
 

Thanks mauricioprado00 : very nice code, very usefull !!

Do you know if is it possible to hide the attribute used ti filter the collection in the layerd navigation?

 
Magento Community Magento Community
Magento Community
Magento Community
 
mauricioprado00
Member
 
Avatar
Total Posts:  63
Joined:  2009-03-11
Argentina
 
cooper - 07 February 2014 09:26 AM

Thanks mauricioprado00 : very nice code, very usefull !!

Do you know if is it possible to hide the attribute used ti filter the collection in the layerd navigation?

Hello Cooper, if you mean to hide the parameter in the url you dont have to, since the code does not actually change the url, it only emulates a parameter as if it was there.

If you meant something else please describe it a little bit more.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cooper
Sr. Member
 
Total Posts:  104
Joined:  2008-03-31
 

Hello mauricioprado,

I was talking about the the name of the attribute displayed by Mage/Catalog/Block/Layer/State.php visible in the block : “Actually Filtered by : “xxxxxx” .  (I hope my english is not to bad to make me understood...) tongue rolleye

 
Magento Community Magento Community
Magento Community
Magento Community
 
mauricioprado00
Member
 
Avatar
Total Posts:  63
Joined:  2009-03-11
Argentina
 
cooper - 07 February 2014 12:52 PM

Hello mauricioprado,

I was talking about the the name of the attribute displayed by Mage/Catalog/Block/Layer/State.php visible in the block : “Actually Filtered by : “xxxxxx” .  (I hope my english is not to bad to make me understood...) tongue rolleye

Hello Cooper, yes it is possible. You have to hide the whole block using this:

<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="page/null.phtml"/>

and creating a null.phtml that has nothing inside. That would hide the entire layered navigation block, but would leave it active so it can actually sort the collection.

On the other hand, I dont know if would be possible to hide just that attribute and leave the others. If that is the case I would just use css to hide it on that specific page, because I cannot think of any easy option to do it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
FmeAddons
Sr. Member
 
Avatar
Total Posts:  123
Joined:  2014-01-15
USA
 

Use this Shop by brand module by Fme to create separate brand pages and list all their product under one page to let use purchase / browse products catalog by specific manufacturer.

For more details - [url=http://www.magentocommerce.com/magento-connect/extension-5-22684.html]http://www.magentocommerce.com/magento-connect/extension-5-22684.html[/url]

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top