So your template file holds <html /> <head /> <body />
tags in it. It will be a bad design, because magento loads all these things through page.xml
layout file. If you want to see those codes.
For simplicity, I assumes you have a 2 column -left
layout for your page. Then the template that holds definitionof this layout has a design like this
#File:app/design/frontend/base/default/template/page/1column.phtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
<head>
<?php echo $this->getChildHtml('head') ?>
</head>
<body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
<?php echo $this->getChildHtml('after_body_start') ?>
<div class="wrapper">
<?php echo $this->getChildHtml('global_notices') ?>
<div class="page">
<?php echo $this->getChildHtml('header') ?>
<div class="main-container col2-left-layout">
<div class="main">
<?php echo $this->getChildHtml('breadcrumbs') ?>
<div class="col-main">
<?php echo $this->getChildHtml('global_messages') ?>
<?php echo $this->getChildHtml('content') ?>
</div>
<div class="col-left sidebar"><?php echo $this->getChildHtml('left') ?></div>
</div>
</div>
<?php echo $this->getChildHtml('footer') ?>
<?php echo $this->getChildHtml('global_cookie_notice') ?>
<?php echo $this->getChildHtml('before_body_end') ?>
</div>
</div>
<?php echo $this->getAbsoluteFooter() ?>
</body>
</html>
As you can see all those tags that your are added through your block is already loading by Magento. "So don't make Magento angry by placing that code in your template file. If magento becomes angry, she will respond badly :)".
More info : Your block is added to the above code by this section.
<div class="col-left sidebar"><?php echo $this->getChildHtml('left') ?></div>
This will add all blocks that comes under left
block that are specified through layout files. So in order to be a part of it,(or to test) you just need to use this design code in your template files.
<p>$this->__('Baby, I am here')</p>
Normally I am using this for testing purposes :)
Conclusion
Without that, I can't see any problem with your code. There is only one chance remain. You may included these template files in wrong position. That would be the most probable reason that resist to show the output
signing off :)
Suppose package:Learning and module: Custom
Module.xml looks like
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Learning_Custom" setup_version="2.0.0">
<sequence>
<module name="Magento_Catalog"/>
</sequence>
</module>
</config>
And then create a layout xml following path -> app/code/Learning/Custom/view/frontend/layout/catalog_product_prices.xml
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/layout_generic.xsd">
<referenceBlock name="render.product.prices">
<arguments>
<argument name="default" xsi:type="array">
<item name="prices" xsi:type="array">
<item name="tier_price" xsi:type="array">
<item name="render_template" xsi:type="string">Learning_Custom::product/price/tier_prices.phtml
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</layout>
Create template inside your module or copy base template file inside your module path should be ->
app/code/Learning/Custom/view/frontend/templates/product/price/tier_prices.phtml
Best Answer
The
<action>
node has been deprecated for a while now, you should stop using it right away. In fact, in Magento 2.2.4 (maybe even earlier) the node doesn't work anymore. With that being said, here are two different ways to accomplish your goal.OR
To add content into your block, you can add additional arguments into the layout xml file. You can also refer to your block by name inside of a plugin. This is the best answer I can give without further clarification to your question.
Update after getting clarification of question. Here is how a child block should be added.
Inside of the file My_Module::history.phtml, you will need to have add one of these lines:
OR