12

When you add a block directly inside header block, magento will put your block just after all of it's child block that are added via other layout xml files that are processed before your pinsearch.xml. Basically a header block contains following blocks by default. This is added via page.xml which will get processed before your pinsearch.xml <block type="...


9

Traditional location for admin blocks is (Example): app/code/YourVendor/YourModule/Block/Adminhtml/... If you'd like to use block with phtml template you'd like to extend \Magento\Framework\View\Element\Template It is valid both for backend and frontend blocks The template for your block should be located under: app/code/YourVendor/YourModule/view/<...


8

As per as magento,the file/folder name after Block,Model,Helper folder should be start with Uppercase and only contain one uppercase for each folder and files. According to magento the file name is Mymenu instead of MyMenu. Class name should be MyNamespace_CustomerDashboard_Block_Mymenu


6

Your file name needs to be changed like this: From vendor_gift_index.xml To gift_gift_index.xml


6

You can try to create a custom module that adds the a block there. Create: \app\code\Custom\Module\registration.php: <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Custom_Module', __DIR__); \app\code\Custom\Module\etc\module.xml: <?xml version="1.0"?> <config xmlns:...


5

Put your js file in your custom module Vendor_Module/view/frontend/web/js/yourjsfile Create requirejs-config.js file in your custom_module/view/frontend. add below code in it . var config = { "map": { "*": { "instapic": "Vendor_Module/js/instapic-slider" } } }; Now call the js file in your .phtml template file by ...


4

That's a lot of questions and hard to give a comprehensive answer without context. But I'll give you some hints. First, you always need a controller if you add new routes (i.e. URLs). There are two options for this: Add a controller to an existing front name. You would add a CategoryController with a secretpageAction in your custom module and configure it ...


4

Two things you really need to check here. You need to whitelist your custom block brandproducts/brandproducts. See this answer for more information. This is required for Magento 1.9 and greater. Make sure your phtml file is in the correct package theme directory. To make sure you can put your phtml file here : app/design/frontend/base/default/template/...


4

There is issue with Magento2 autocomplete in consequence of extending of base jquery-ui widget by Magento application. More details by link: Magento 2 & JQuery.UI.Autocomplete


4

For the regular frontend pages the content block is defined in the app/design/frontend/base/default/layout/page.xml: <default translate="label" module="page"> <label>All Pages</label> <block type="page/html" name="root" output="toHtml" template="page/3columns.phtml"> ... <block type="core/text_list" name="...


4

I have tried and its working for me. <referenceContainer name="page.wrapper"> <container name="page.wrapper.second" as="page_wrapper_second" htmlTag="div" htmlClass="my-custom-div" before="main.content"> <block class="Magento\Cms\Block\Block" name="your_banner_block"> <arguments> ...


4

$array = array(); $array['currentTime'] = date("H:i", time()); $array['someValue'] = 123; $this->loadLayout(); $this->getLayout() ->getBlock('newsletter_popup') ->assign('array', $array); $this->renderLayout();


4

You have to just add data-form-part="forrname_form" in your input filed forrname_form it's must be similar with your ui form name your code shold be like now: <tr> <?php foreach ($block->getStores() as $_store): ?> <td class="col-store-view"> <input data-form-...


4

Call phtml like this below way : <?php echo $block->getLayout() ->createBlock('Codism\Csr\Block\Index\TopMenu') ->setTemplate('Codism_Csr::menu.phtml') ->toHtml(); ?> Or <?php echo $this->getLayout() ->createBlock('Codism\Csr\Block\Index\TopMenu') ->setTemplate('Codism_Csr::menu.phtml') ->toHtml();...


4

There are a few problems in your module: You have used Outdoor_Configurator in module.xml but in Controller, Block, and layout you have used Vendor_Module. registration.php is missing from the code you have shared. You have not mentioned the file names and their paths. There may be a problem in the file naming convention. Update: Problems found in module ...


4

You need to create this file in your custom module/theme to add custom Block on cart page. app/code/Vendor/Module/view/frontend/layout/checkout_cart_index.xml Content for this file is.. <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/...


3

You want to call the block function from model. Try the below code Mage::getBlockSingleton('<your-block-alise>/address_edit')->yourFunction(); Note : Calling the block from model is not recommended.If you are going to use a same function in Block and Model. Place that function in Helper and call where ever you want


3

Use top.container instead of content as a reference. top.container is a container within the header element, just below the top menu.


3

I would say creating a block instance inside a model in this manner would be considered fairly non-standard. Conventionally the block layer would use the model layer (either by instantiating directly, or by retrieving models from global state such as the registry), rather than the other way around. It's a little difficult to advise without knowing exactly ...


3

As John pointed out $this references the block object in Magento itself. All templates are rendered with a block. But I want to give you a little more information: Block types There are two main types of blocks - those that utilize a template and those that do not. All template rendering block types inherit from Mage_Core_Block_Template and all others ...


3

In the context of any given block, $this is defined as the block type so in your theme or module definition layout updates, you would need to update the block type to point to the correct block. <block type="sales/order_info" as="info" name="sales.order.info"></block> This is an example block from the Mage_Sales module so when that blocks ...


3

Make sure you have the case correct. I.e. Register, not register. – Smartie Thanks Smartie the issue was the wrong case for my module. I created folders with lower case and used upper case in code. ;-)


3

After trying to execute the given SQL query in phpmyadmin for a default Magento database, I got the following error: #1054 - Unknown column 'e.name' in 'field list' What this means is that the column name does not exist in the table e which is an alias for the table catalog_product_entity. After taking another look at the SQl query, I can see that you are ...


3

Create catalog_category_view.xml and call your custom form block app/code/Vendor/Module/view/frontend/layout/catalog_category_view.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <...


3

You need to create layout file checkout_cart_index.xml at below path and paste this below code : app/code/VendorName/ModuleName/view/frontend/layout/checkout_cart_index.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/...


2

Auto render child blocks for Mage_Core_Block_Text_List As per as magento,a block is automatically rendered when it parent block class is Mage_Core_Block_Text_List. On first xml code ,you have put <block type="core/template" after="-" name="my.block" template="my_dir/myblock.phtml" /> as child block of block content. see at page.xml <block type=...


2

There small mistake in yours block class class AD_Donations_Blocks_Category should be class AD_Donations_Block_Category Also Category.php path location AD/Donations/Block/ Please check how create a extension: http://www.amitbera.com/create-an-magento-extension-with-custom-database-table/


2

Your error says, it cant find the block MyNamespace_CustomerDashboard_Block_Mymenu. As per this hint, Your block class should be at app\code\local\MyNamespace\CustomerDashboard\Block\Mymenu.php. Please note you have MyMenu.php. It should be Mymenu.php. Also you need to ensure the class name is MyNamespace_CustomerDashboard_Block_Mymenu. or you can avoid ...


2

Add this in your your_theme_path/layout/local.xml instead. <?xml version="1.0"?> <layout version="0.1.0"> <catalog_product_view> <reference name="product.info"> <block type="catalog/product_view" name="product.info.rating" template="rating/rating.phtml"/> </reference> </catalog_product_view> </layout&...


2

I had the same issue with my setup. When Magento 2 is installed with the composer installer, the autoloader could not find the class. To solve this, you have to add the following line in the psr-4 section of your root composer.json file. "SL\\": "app/code/SL/" Then run composer install and the class will be found


Only top voted, non community-wiki answers of a minimum length are eligible