I want to add a custom CMS Block into my category per category. So I created a Custom CMS Block:
Title: TestBlock
Identifier: testblock
Then I enter into my category and under Custom Design Tab - in the Custom Layout Update textarea, I add the following
<reference name="left">
<block type="cms/block" name="TestBlock" after="catalog.compare.sidebar">
<action method="setBlockId"><block_id>testblock</block_id></action>
</block>
</reference>
This adds the content of my custom CMS Block in the sidebar, but the positioning is wrong. Instead of adding it at the bottom of the sidebar (last block is the Compare Products), it ends up at the top. Any ideas how to position it properly? I'm using Magento CE 1.9.0.1
Try not using "after" in your block, it may work.
You may try as per following.
<reference name="left">
<block type="cms/block" name="TestBlock" after="-">
<action method="setBlockId"><block_id>testblock</block_id></action>
</block>
</reference>
Related
I'm running Magento 1.9.1.0 with the RWD theme. When setting the page layout to 2 columns with left bar I can see the filters in the left sidebar correctly (sort by price etc). How can I get this working in the 1 column page layout (for categories only)? I'd like to create a full-width version of this at the top of my products using something like the Catalin SEO catalog layered navigation (for the slide price bar etc).
The 1column.phtml template does not have the left block, which is where the layer view block is usually injected. One way to do this in your local.xml is to put the block in the content (or after_body_start or before_body_end, or any core/text_list child block):
<catalog_category_default>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
<reference name="content">
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
<block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
</block>
</reference>
</catalog_category_default>
In your css, you can hide the layer block html if you don't want it to show but still want it to load:
.category-mycategory .block-layered-nav {
display: none;
}
mycategory is your category name.
I have my homepage redirected to a product page, but I still want my banners from the home page to show up.
Anyone have any clue how I can add banners to my product page ? Pretty new to Magento... Certainly not as easy as Joomla.
There are handles in Magento who decide what block to show when specific controller is called.
Take a look at this file
/magento/app/design/frontend/base/default/layout/catalog.xml and find following lines
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate">
<template>page/2columns-right.phtml</template>
</action>
</reference>
<reference name="content">
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<!-- Some more code -->
</block>
</reference>
<!-- Some more code -->
</catalog_product_view>
catalog_product_view is the handle you may want to use for displaying the banner on product page.
Pick that handle and write the block specific code.
If you want to use an extension to simplify your task here is the one.
You can call banner code on products page. Or if you want to go with simple technique, use iframe
I'm working on a module in magento admin where I would like to show the scope selector as in manage products, manage categories, system configuration for my grid edit form.
Can anyone help me how could I add that and store values in database specific to the scope selected?
By searching on the store switcher, you can see Magento adds it by adding it in the layout file:
<your_layout_handle_here>
<reference name="left">
<block type="adminhtml/store_switcher" name="store_switcher" template="store/switcher.phtml" />
</reference>
</your_layout_handle_here>
For not show the confirm alert add an action in this block as in a core
<block type="adminhtml/store_switcher" name="store_switcher" before="-">
<action method="setUseConfirm"><params>0</params></action>
</block>
This is perplexing me somewhat.
I'm on magento 1.7.
I have a left sidebar on all pages, and I'm trying to add a vertical navigation block to this side bar, to appear on all pages. So far, through editing catalog.xml, I can get it to appear on the front page, and the individual product pages, but it disappears when I visit a category page (the one that lists all the products in a category). When I try to add this block in via the "Custom Design" option for the category in the backend, it inserts the block into the sidebar 5 times, one on top of the other.
In catalog xml, right under < !-- Mage_Catalog -->
<block type="catalog/navigation" name="catalog.leftnav" template="catalog/navigation/vert_nav.phtml" before="cart_sidebar" />
I think I've tried placing this is every place in catalog.xml that seemed to make sense, but I just can't figure out why I can't target the categories, and why the multiple blocks problem is happening.
I have also tried to add the block to page.xml, and although that works for the front page, it doesn't for the categories.
Thanks in advance
Please check if you have done as follows correctly.
On catalog.xml search Catalog Category (Non-Anchor) and locate <reference name="left">
by default it is
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
Change it to
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
<block type="catalog/navigation" name="catalog.vert_nav" template="catalog/navigation/vert_nav.phtml" before="catalog.leftnav" />
</reference>
Do same for Catalog Category (Anchor)
Hope above helps.
I have a customer who has a drop-ship type of Magento site, new products go live every month - I need to figure out a way to make all the products ideally go live at once, as well as the changes to all the pages.
Many of the pages that display a list of category products reference static blocks, whose content also needs to change..
an example:
{{block type="cms/block" block_id="category-art-october-2013"}}
{{block type="catalog/product_list" category_id="41" template="catalog/product/list.phtml"}}
{{block type="cms/block" block_id="coming-soon-art-october-2013"}}
Is it the best way / possible to have some kind of variable in the static block, so that I can change some sort of date/identifier and have it load in the correct month of products?
instead of using {{block type="cms/block" block_id="category-art-october-2013"}} {{block type="catalog/product_list" category_id="41" template="catalog/product/list.phtml"}} {{block type="cms/block" block_id="coming-soon-art-october-2013"}}
you can try doing this via the xml layout updates, which would allow you to use "Custom Designs" with "from" and "to" dates.
under Layout Update XML from your cms pages, you can try something like this
<reference name="content">
<block type="cms/block" name="art-october">
<action method="setBlockId"><block_id>category-art-october-2013</block_id></action>
</block>
<block type="catalog/product_list" name="list_category" template="catalog/product/list.phtml">
<action name="setCategoryId">41</action>
</block>
<block type="cms/block" name="art-comming-soon">
<action method="setBlockId"><block_id>coming-soon-art-october-2013</block_id></action>
</block>
</reference>
and the prepare the configuration for the next month under "Custom Design" and adjust the xml to you needs.
hope that helps