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
Related
I am new to Magento and would appreciate some help.
I struggled to add the newsletter widget to my left column.
I was able to do so by :
1) Going to CMS-->Widget and creating a new Widget, with the type as CMS Static Block, my title i set as Newsletter. I set to display on all pages, and the block reference i set to Left Column.
2) I then went to CMS-->Static Blocks, created a new block called newsletter and updated the content with:
{{block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml"}}
However if I do this, then the block does not show up, if I change it to
{{block type="core/template" template="newsletter/subscribe.phtml"}}
the widget show, but does not update update subscription, I understand from other posts that this will not work.
What do I need to do tho get the newsletter/subscribe working?
in app/design/frontend/theme/theme/layout/newsletter.xml:
Change from :
<reference name="footer">
<block type="newsletter/subscribe" name="footer.newsletter" as="newsletter" before="footer_store_language" template="newsletter/subscribe.phtml"/>
</reference>
To
<reference name="left">
<block type="newsletter/subscribe" name="left.newsletter" template="newsletter/subscribe.phtml" before="-" />
</reference>
It would help to enable the module under System--->Advanced--->Advanced.
I have used mobileshoppe theme for magento and trying to display recently viewed product list at product details page but some how its not working...
Added code below at catalog.xml
<catalog_product_view translate="label">
<reference name="content">
<block type="reports/product_viewed" name="product.recently.viewed" as="product_recently_viewed" template="reports/product_viewed.phtml"/>
</reference>
</catalog_product_view>
and below code at app\design\frontend\default\mobileshoppe\template\catalog\product\ view.phtml
<?php echo $this->getChildHtml('product_recently_viewed') ?>
I have tried the same with default theme and its also not working, can any one help me to figure out this issue ?
Thanks...
On the the product detail template (view.phtml) you have to be more specific in the xml where you want to place the block. See the example below using local.xml in the theme layout directory (app/design/frontend/your package/your theme/layout/local.xml) to insert the block. Here's an example from a site I'm working on. Ironically we are having problems with it displaying consistently, which I'm trying to figure out right now, but this is working most of the time! Try getting more specific in your catalog.xml and it should work. The xml is in local.xml, the echo is in catalog/product/view.phtml
<?php echo $this->getChildHtml('recently_viewed') ?>
<catalog_product_view>
<reference name="content">
<reference name="product.info">
<block type="reports/product_viewed" name="left.reports.product.viewed" template="reports/product_viewed.phtml" as="recently_viewed" />
</reference>
</reference>
Can you please replace xml reference content to left.
Instead of this
<reference name="content">
Use below and check
<reference name="left">
As it is a part of sidebar so it should work with left / right column as you want to display in page.
Cheers!
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"}}
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.
In my site home page, I have three blocks like Recommend product,Top ten product and Talking about product, All products are coming properly by their attribute name.For this, I create three attribute in admin section and add layout design in home page in admin section and add block type in page.xml and i call this blocks by their name in 2column-left.phtml
echo $this->getChilidHtml("block_names")
But,My problem is when i click on any product it will redirect to product details page that is catlog/product/view.phtml, on this page i want to add two different blocks as like home page ,I found its xml page also , I think that is catalog.xml on this page make changes in side the content reference and it is coming ,but i want to add a new block as line content , i was trying but i am not getting any idea please any solution for this.
<catalog_category_layered>
<reference name="recommend">
<block type="catalog/product_list" name="catalog.product_list" as="recommend_list" template="catalog/product/view/recommend.phtml">
</block>
</reference>
</catalog_category_layered>
I add above line code in catalog.xml as a new block and call it in view.phtml as echo $this->getChildHtml('recommend') but it is not showing,I am sure this approach is wrong one .
any solution for this how can i call.
Thanks & Regards
Try this,In your catalog.xml
<catalog_product_view translate="label">// find this line
<reference name="content">
..............
<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
<block type="catalog/product_list" name="catalog.product_list" as="recommend_list" template="catalog/product/view/recommend.phtml"/> //add your block into product.info block
.............
</block>
</reference>
................
</catalog_product_view>
call the your block using name in in catalog/product/view.phtml
echo $this->getChildHtml('recommend_list')
Hope this helps