Hi please check this link http://majorcomfort.com/index.php/benches.html
in this there is a
shop by category bock in the side bar
, i need to show this in the centre of page can anybody help me how can i do this
i have tried to
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<block type="catalog/layer_view" name="filter" template="catalog/layer/view.phtml"/>
in catalog.xml
and in list.html
i have use <?php echo $this->getChildHtml('filter');?>
but it shows nothing
Based on your question, I'm not clear on which block you would like it be placed in. There are a number of ways to achieve this but to give you some basic guidance.
Try turning on template hints in the backend. You will then see markup surrounding all of your various blocks. On top of the markup, you will see a file path from inside the app/ folder of your Magento install. Open up the file that corresponds to your sidebar nav (usually something like catalog/navigation/left.phtml). From there you will be able to find the specific code you need and you can place it into one of the blocks up top (e.g. category-header.phtml, header.phtml, etc..). I would however recommend creating your own block and possibly switching to a 1 column layout but again, I'm not clear on what you ultimately want your design to look like.
Let me know how else I can help.
Related
I've yet to find a proper answer for this, therefore I decided to ask it here.
I'm new to Magento and trying to develop an extension that'll modify the product and category pages.
I want to make it work in every template, meaning I'll need to find a way to modify these pages without editing the template files.
How can I achieve this functionality?
you can use the following observer to change the content in template(phtml) file with edit the core template file.
core_block_abstract_to_html_before
core_block_abstract_to_html_after
refer this
You could also use the given Child-Blocks within the respective view files. /catalog/product/view.phtml for example contains <?php echo $this->getChildHtml('other');?>. So you could use that and add a block via your layout.xml and refer to that, for example:
<catalog_product_view>
<reference name="product.info">
<block type="core/template" name="product.info.other" as="other" template="someTemplate.phtml"/>
</reference>
</catalog_product_view>
You could use any of the blocks echoed in the template and just wrap it in your own template file. Of course, you wouldn´t really change the whole page really, but you could add a lot without touching any core .phtml-files.
Sup Stackers!
I need your help dearly. I'm pretty much a beginner when it comes to Magento. I would like to display a custom set of links on my page sidebar, the sidebar that holds blocks such as Categories, Compare Products etc. I've tried the following:
<reference name="right">
<block type="cms/block" name="right.permanent.callout">
<action method="setBlockId"><block_id>favourites</block_id></action>
</block>
</reference>
No result. The above references a cms static block I've created that just contains a UL of links. The indentifier for the block is favourites. Whenever I try to get the unordered list to show on the page by including the above in the CMS page Layout XML via the Admin panel, I get nothing happening at all. One thing to note is that, as a test, I deleted all the content that was currently in my home pages Layout XML and it changed nothing, all the sidebar content still remained.
After trying about 10 different alternatives, I'm still no closer to getting the to work. Anyone got any ideas on how to get this to work?
Your code looks like what it should be to get this working. A few things to check is the "name" attribute and caching. Give the block a unique name, such a "favourites." You can also add a "before" or "after" to position this block exactly where you want to on the sidebar, just reference the block name that you want it to appear before or after.
<reference name="right">
<block type="cms/block" name="favourites" before="-">
<action method="setBlockId"><block_id>favourites</block_id></action>
</block>
</reference>
This should get it working. You mentioned that you removed all the code from the Layout Update XML without any changes taking effect. I don't think caching is your problem but I just want to mention it since it's still a possibility. It may have to do with how the default code is commented out, so all you're doing is removing code that isn't being applied to the layout. Hopefully this helps because I think you're right there, good luck!
i am working on a magento site that has the M2EPro Extension which has an ebay template in it. The page that was created by the previous developer has markup such as:
#ebay_name#
#sku#
#description#
{{block id="ebay_shipping"}}
Are these built into magento? Where can a get a list of other tags i can put into the html template? I have looked deeply into the magento documentation and cant find anything regarding this. Thanks
They are not built into magento, they can be seen through PHP or XML. A nice outline can be seen here. As for the native magento blocks I am unable to find a set list of native Magento blocks. It's not very documented for whatever reason. You can poke around in the layout directory of your theme app/code/design/frontend/default/YOUR_THEME/layout to find the XML files. There you will see something like:
<reference name="left">
<block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"/>
</reference>
We can all this block in a CMS page or Static Block via the following:
{{block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"}}
I hope this helps a little bit! Not a direct answer but at least it's a start!
I would like to able load my 'wishlist' on header block in my magento-1.6 site.
I am using magento1.6.2.0. Now my wishlist is showing up on left side block.
I just changed the reference of wishlist.xml from left to header like
<reference name="header">
<block type="wishlist/customer_sidebar" name="wishlist_sidebar" as="wishlist" template="wishlist/sidebar.phtml"/>
</reference>
But its not coming
How can I achieve that..? Which xml file i want to edit ..?
All layout XML files are one - that is, they are merged as part of typical rendering.
You need to edit the page/html/header.phtml file and add this bit of code:
<?php echo $this->getChildHtml('wishlist') ?>
Before you do any of this though you should read through the articles at the Official Magento Knowledge Base, paying particular attention to the theme hierarchy and developer articles. The time to get theme customizations right is at the beginning of a project.
I made my own product list page based on Mage_Catalog_Block_Product_List:
app/code/local/Mage/Catalog/Block/Product/Special.php:
class Mage_Catalog_Block_Product_Special extends Mage_Catalog_Block_Product_List
{
/* Original contents */
/* Here I call addAttributeToFilter on product collection, and then... */
return $this->_productCollection;
}
I include this in a CMS page on the center column:
<reference name="content">
<block type="catalog/product_special" template="catalog/product/list.phtml" />
</reference>
The problem is: The product list shows up just fine, but I get no layered navigation in my left column.
This is quite strange, since I am using exactly the same template as normal listings.
A couple of things I have checked:
Mage_Catalog_Block_Product_Special just being a proxy class. This doesn't work. Even if I use block type "catalog/product_list" on my CMS page I will not get a layered navigation.
There are no extensions that are overriding crucial core classes.
I have also tried to create my own module and list it under for example 'mycatalog'. This results in exactly the same problem.
I have a feeling this has to do with trying to include a product listing on a CMS page but I have not been able to track down the exact problem.
Any help on this would be very much appreciated.
You need to add the Block that renders the Layers into the left column.
If you look in catalog.xml, you will see that the catalog_category_layered node includes the following:
<reference name="left">
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
...
</reference>
So, add that into your CMS xml layout update and that should display the Layer block on your CMS page.
If you have issues with the product list not being filtered when you click one of the filterable attributes, that is probably because the links rendered by the Layer_View Block assume that they are going to post back to a CategoryController, not a CmsController which will be rendering your CMS page. That may or may not be an issue, so report back here if it doesn't work and we can try to work through it.
Personally I would have a hidden category with all products in it and use a script to keep that updated to be all products. The script can be done with the API, slow yes, but it will work in a timely fashion for a certain level of SKU count.
layer navigation is include in category view.
You should include the part of navigation used by category, so try to insert
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
before
<reference name="content">
I'm not sure but if it's doesn't works it should help you to understand the problem anyway
check the following pages ( they came across the same problem )
http://www.exploremagento.com/magento/some-custom-blocks-to-help-you-show-products.php
http://www.chilipepperdesign.com/2009/03/23/magento-how-to-list-all-the-products-in-a-single-category-in-a-sidebar-block