Custom Content on Sidebar of Magento - php

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!

Related

Left sidebar appearing on grouped product page

I have a minor bug/issue with my Magento site.
I've started to make a few group products, and all of the grouped product pages are broken.
It looks like 1 or both of the sidebars appear on the product page and "squeeze" the product info into the middle of the page.
I am using the "ultimo" theme.
Can anyone suggest how I can try and fix this myself?
I can probably fix it myself, if someone is able to point me to the correct file and suggest a code to fix.
Here is the example:
To me this page looks like it is set to the base template 3-columns rather than 2-columns-right.
Since you say it only happens with grouped products have a look in your layout xml files for the handle PRODUCT_TYPE_grouped then with this handle you will probably see something as follows.
<reference name="root">
<action method="setTemplate"><template>page/3columns</template></action>
</reference>
I guess it should be:
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>

Making a new page template for a different product page

I've been trying to figure this problem out for several hours now - I've made two page templates for the products one is named vxs-view.phtml and the other is view.phtml. There located in the same directory.
The solution I tried was to input
<reference name="product.info">
<action method="setTemplate"> <template>catalog/product/view/vxs-view.phtml</template></action>
</reference>
However this only works if that product is in a certain category. Is there a way I can add the pay layout to the template files in the design tab?
I've been adding this code to the front end system/custom design/ custom layout update box
Sorry I'm need to magento and still learning.
Thanks for any help
you are placing wrong reference type. Please try below code.
<module_page_action> <!- Enter your modulename_pagename_action e.g. catalog_product_info-->
<reference name="root">
<action method="setTemplate"> <template>catalog/product/view/vxs-view.phtml</template></action>
</reference>
<module_page_action>
Hope this will work for you!
Cheers!

move side block to centre in magento

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.

How to show wishlist block in header magento

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.

Magento, custom product list

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

Categories