I have reviwed your request Please follow below steps.
You need to create 'Search Module' folder under your puma theme and copy default.xml into layout
(e.g) puma > Magento_CatalogSearch > layout > default.xml
To move top.search you need to write following code in your (puma > Magento_CatalogSearch > layout > default.xml)
<move element="top.search" destination="header.panel" before="header.links"/>
To move minicart you need to write following code in your (puma > Magento_Checkout > layout > default.xml)
where
header.panel is <referenceContainer>
of header.links please review luma > Magento_Theme > layout > default.xml
<referenceContainer name="header.panel">
<block class="Magento\Framework\View\Element\Html\Links" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
or you can also write directly into (puma > Magento_Theme > layout > default.xml)
<move element="top.search" destination="header.panel" before="header.links"/>
<move element="minicart" destination="header.panel" after="top.search"/>
please let me know if it's not working.
(1) first create a new module with a custom eav for your product content (this is just the InstallData.php
content):
<?php namespace <vendor>\<module_name>\Setup;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
/**
* @codeCoverageIgnore
*/
class InstallData implements InstallDataInterface
{
/**
* EAV setup factory
*
* @var EavSetupFactory
*/
private $eavSetupFactory;
/**
* Init
*
* @param EavSetupFactory $eavSetupFactory
*/
public function __construct(EavSetupFactory $eavSetupFactory)
{
$this->eavSetupFactory = $eavSetupFactory;
/* assign object to class global variable for use in other class methods */
}
/**
* {@inheritdoc}
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
/** @var EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
/**
* Add attributes to the eav/attribute
*/
$eavSetup->addAttribute(
\Magento\Catalog\Model\Product::ENTITY,
'my_attribute',
[
'type' => 'text',
'backend' => '',
'frontend' => '',
'label' => 'my custom content',
'input' => 'textarea',
'class' => '',
'source' => '',
'global' => 1,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_in_product_listing' => true,
'wysiwyg_enabled' => true, // if you want a wysiwyg editor
'unique' => false,
'apply_to' => 'simple,configurable,virtual,bundle,downloadable,grouped',
'group' => 'General'
]
);
$setup->endSetup();
}
}
(2) in the module extend catalog_product_view.xml
to insert your attribute:
[I added mine as a new product tab]
<referenceBlock name="product.info.details">
<block class="Magento\Catalog\Block\Product\View\Description" name="{SOME_NAME}" template="product/view/attribute.phtml" group="detailed_info">
<arguments>
<argument name="at_call" xsi:type="string">getMyAttribute</argument>
<argument name="at_code" xsi:type="string">my_attribute</argument>
<argument name="css_class" xsi:type="string">{some class if you like}</argument>
<argument name="at_label" xsi:type="string">none</argument>
<argument name="title" translate="true" xsi:type="string">My tab label</argument>
</arguments>
</block>
</referenceBlock>
(3) now you can go to your magento admin and insert custom content (even html) into the attribute content like for every other attribute
Best Answer
The breadcrumbs block is a child block of the
page.top
container which is itself placed just afterheader.container
It is declared under
Magento\Theme\view\frontend\layout\default.xml
:To place your block before the breadcrumbs you can do the following: