Magento Block Placement - magento

I want to add the block section below on the product detail section
currently its above
as shown in below image
does any one knows this?
my layout is
1st for facebook comment
<reference name="product.info">
<block type="facebookcomments/catalog_product_comments" name="product.info.facebookcomments" template="facebookcomments/catalog/product/comments.phtml"/>
2nd is for facebook like
<reference name="product.info">
<block type="facebookilike/catalog_product_facebookilike" name="product.info.facebookilike" template="facebookilike/catalog/product/facebookilike.phtml"/>
still not getting this

In catalog_product_view handle of your theme/module layout:
(note i'm pseudo-coding based on the debug block names in your screenshot. I may not have the correct block/template/handles, but you get the idea)
<reference name="content">
<block type="mageplace_facebook/like_catalog_product_facebooklike"
after="product.info"
name="facebook.like.block.name"
template="path/to/facebooklike/template.phtml" />
</reference>
Check the layout xml of the Facebook Comments module, as it's obviously in the right place.

Related

Updating custom block in CMS page

I'm having a bit of trouble understanding how to update a custom block that I include in a CMS page.
I am using the standard shortcode in the CMS page, which works fine:
{{block type="catalog/product_list" category_id="16"
template="catalog/product/slider_list.phtml"}}
I am trying to set the column count of this custom custom block, for which I've found that I need something like the following piece of code:
<block type="catalog/product_list" name="catalog.product.slider_list"
template="catalog/product/slider_list.phtml">
<action method="setColumnCount"><columns>4</columns></action>
</block>
I'm not exactly sure under which <reference /> block I should place the code... I looked in catalog.xml, and if I try to place it between <reference name="root" />, I do not get the correct behavior.
Thank you.
Edit: use of incorrect terminology; I was calling the block static, where in fact it is a custom block.
if you want to call it on home page where the reference name should be like in your local.xml or any of the xml of your extension. just add it like below
<cms_index_index>
<reference name="content">
// your custom block
<block type="catalog/product_list" name="catalog.product.slider_list"
template="catalog/product/slider_list.phtml">
<action method="setColumnCount"><columns>4</columns></action>
</block>
</reference>
</cms_index_index>
hope this will sure help you.

agreements are empty with germansetup in Magento

From my /checkout/onepage/ there is a popup window for the AGB: /germansetup/frontend/agreements/id/1/
Problem is that this page does not show any text. Just a background image from the template.
The popup is defined in germansetup.xml:
<germansetup_frontend_agreements>
<reference name="root">
<action method="setTemplate"><template>page/popup.phtml</template></action>
</reference>
<reference name="content">
<block type="core/text" name="agreement" />
</reference>
</germansetup_frontend_agreements>
I don't know what block he is trying to load here but I would like him to show my static block mrg_business_terms.
This appears to have changed at some point. For me (using Magento 1.9.2.4), what worked was adding 'cms/block' to the list of whitelisted blocks.
Have a look at Sales > Terms and Conditions (German: Verkäufe > Bestellbedingungen).
Here you see the list of checkout agreements. In my case I needed to change the content block id:
{{block type="cms/block" block_id="mrg_business_terms"}}

Change Position of Newsletter Sidebox in Magento

Thank you for any help in advance.
I am trying to change the order in which sideboxes appear in magento. Such as the: My Cart, Newsletter, Poll, Recently Viewed Products.
Currently I am trying to make the Newsletter box display last.
In app/design/frontend/default/MY_TEMPLATE/layout/newsletter.xml
I have the following code:
<default>
<!-- Mage_Newsletter -->
<reference name="left">
<block type="newsletter/subscribe" name="newsletter" after="-" template="newsletter/subscribe.phtml" />
</reference>
</default>
Yet even with after="-" as shown in the code, the newsletter is still showing up 1st.
I have flushed all caches, and have re-indexed every time I make a change to no avail.
EDIT:
Changing
<reference name="left">
TO
<reference name="right">
Moves it to the bottom of the list. However, the column is actually on the left. Any ideas why this works?
It's all in the order of left's sortedChildren entries. Try getting rid of the custom newsletter.xml, creating a local.xml file in your custom theme, and adding the following:
<?xml version="1.0"?>
<layout>
<default>
<action method="unsetChild" block="left">
<block>left.newsletter</block>
</action>
<action method="insert" block="left">
<block>left.newsletter</block>
<sib />
<after>1</after>
</action>
</default>
</layout>
What this does is remove the block reference from the list of sorted children blocks and then adds it again at the end. Ref. Mage_Core_Block_Abstract::insert() [link].
I've employed an unused but valid block attribute for the <action /> tag rather than wrap it in <reference />. I believe the effect is the same.
Check the block names(in layout xml files) which is displaying in your left/right sidebar.
You can find something like this
<reference name="right">
<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
</reference>
The above code will display cart sidebar then compare sidebar. Consider this is your last block in your sidebar. If you want to newsletter after this block you have to specify
<reference name="right">
<block type="newsletter/subscribe" name="newsletter" after="catalog.compare.sidebar" template="newsletter/subscribe.phtml" />
</reference>
You have to specify block names in after/before element tag. Find your left/right sidebars last block name and use that name in your newsletter block.

getChildHtml('content') in magento?

Anybody please help me
I can't find getChildHtml('content')
I'm new in magento?
Where is getChildHtml('content') in magento?
see
<reference name="content">
<block type="catalog/navigation" name="catalog.leftnav1" template="catalog/navigation/left_nav.phtml"/>
</reference>
writing the above code will display all the contents in left_nav.phtml(php+html[view part]) in the content part of that page.
Mainly there are :
<reference name="left">--->display in left side of page
<reference name="right">--->display in right side of page
<reference name="head">--->display in head side of page
<reference name="content">--->display in middle of page
getChildHtml('content')--->will display all page declared under <reference name="content"> in the middle part of the called layout page.
This is a slight overview of your doubt.Make an effort to learn from googling.Good Luck
You may get childhtml('content') in every layout.phtml files like 1column.phtml and other in app/rwd/default/page

Magento - Adding to the Layout

I have this section in one of my layout files:
<blog_post_view>
<reference name="content">
<block type="blog/post" name="post" template="aw_blog/post.phtml" />
<block type="socialbookmarking/bookmarks" name="bookmarks" template="bookmarks/bookmarks.phtml"/>
</reference>
</blog_post_view>
This first block shows a post and the second block shows some social bookmarking icons. The problem is the section which displays the post also displays the 'add comments' section. I want to add the social icons between the post and the comments.
How can I do this? Ie. add the Social block in the middle of the Post block?
Thanks!
Change it to:
<blog_post_view>
<reference name="content">
<block type="blog/post" name="post" template="aw_blog/post.phtml">
<block type="socialbookmarking/bookmarks" name="bookmarks" template="bookmarks/bookmarks.phtml"/>
</block>
</reference>
</blog_post_view>
and then inside the post template (aw_blog/post.phtml) put the following where you want the bookmark-things to appear:
<?php echo $this->getChildHtml('bookmarks'); ?>

Resources