How to enable custom system configuration in Magento 2.3.*? - magento

I am currently working on a Magento project where I have to add a custom system configuration to manage my hosts.
I followed an old configuration I have used in an old project which uses the Magento version 2.2.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="catalog" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="config" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Setup</label>
<field id="host" translate="label" type="text" sortOrder="67" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Host</label>
</field>
</group>
</section>
</system>
</config>
But starting from Magento 2.3 this solution doesn't work anymore.
Do I have to enable the configuration manually in order to see it in the admin configuration panel?

I tried your snippet and it works fine with me.
Maybe there is a confusion between the Catalog Tab (blue underline), and the 'Catalog Section' (yellow highlight) ?
Tell me if so, i'll give you the snippet that you need.

Inside the section, you are missing the following nodes:
<section ...>
<tab>$TAB</tab>
<label>$LABEL</label>
<resource>$RESOURCE</resource>
</section>

Related

Changing from magento plugin does not make effect , but changing from magento\vendor shows effect

I am pretty new to Magento and using Magento 2.2.6 to develop a plugin. I need to edit the search bar. So I added a file to my plugin folder
Plugin \view \frontend \ templates \ form.mini.phtml
This does not making any changes in my website. But when I put that same file into Magento \vendor \magento \module-search \view \frontend \templates\ form.mini.phtml . Now I want not to any files from that vendor folder. What can I do now ? Thank you.
Block form.mini.phtml define in Vendor\magento\module-search\view\frontend\layout\default.xml
<!--Vendor\magento\module-search\view\frontend\layout\default.xml -->
<referenceContainer name="header-wrapper">
<block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" />
</referenceContainer>
Overwrite using layout in your module app\code\VendorName\view\frontend\layout\default.xml
edit file form.mini.phtml and put it to app\code\VendorName\view\frontend\templates\form.mini.phtml
<!-- app\code\VendorName\view\frontend\layout\default.xml -->
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header-wrapper">
<block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="VendorName_ModuleName::form.mini.phtml" />
</referenceContainer>
</body>
</page>
You can also overwrite the file in the theme without the layout file
edit file form.mini.phtml and put it to app\design\frontend\Vendor\ThemeName\Magento_Search\templates\form.mini.phtml

Magento 2 How can i override core system.xml file

I am using Magento 2.2.3 version. I have facing the problem in override core Magento CatalogInventory system xml file.
In default magento 2 backorders system configuration setting is global. I want to change that setting website wise.
For this i have created one module in which etc/adminhtml directory i have created system.xml. Here is my custom module system.xml code.
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="cataloginventory" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="item_options" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<field id="backorders" translate="label" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>Backorders</label>
<source_model>Magento\CatalogInventory\Model\Source\Backorders</source_model>
<backend_model>Magento\CatalogInventory\Model\Config\Backend\Backorders</backend_model>
<comment>Changing can take some time due to processing whole catalog.</comment>
</field>
</group>
</section>
</system>
</config>
I have research in google and found this link :
https://inchoo.net/magento-2/allow-backorders-website-scope/
but it's did not worked for me.
I want to override Magento_CatalogInventory system.xml file and change backorders setting showInWebsite from 0 to 1.
Can you please help me for override or chnage core system.xml file in my custom module ?

Magento overriding the email header and footer

I am working on new Magento project. Basically I want to modify Magento's default email header/footer.
I have noticed that one question posted related to this, but it doesn't seems to be properly answered.
I have added my code below
app/code/local/Toystore/Common/etc/config.xml
<config>
<modules.............>
.......................
</modules>
<global>
<helpers>
...............................
</helpers>
<template>
<email>
<design_email_header2 translate="label" module="toystore_common">
<label>Email - Header</label>
<file>html/headercustom.html</file>
<type>text</type>
</design_email_header2>
<design_email_footer2 translate="label" module="toystore_common">
<label>Email - Footer</label>
<file>html/footercustom.html</file>
<type>text</type>
</design_email_footer2>
</email>
</template>
</global>
</config>
And in my template I have added like following to call this
{{template config_path="design/email/header2"}}
And my html files resides in
app/locale/en_US/template/email/html/headercustom.html
I am not sure why its not calling my new file, because the email is coming without header.
Please advise
You just need to edit the config at System > Configurations > Visual > Transactional Emails

How to create a simple administration panel for my joomla plugin

I think the problem lies in my xml.
<?xml version="1.0" encoding="UTF-8"?>
<extension version="2.5" type="plugin" group="content">
<install>
<name>Content - eya</name>
<author>eya</author>
<creationDate>February 2013</creationDate>
<copyright>(C) 2013 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>anigag#grzeit.com</authorEmail>
<authorUrl>www.eya.com</authorUrl>
<version>2.5.0</version>
<description>Adds eya plugin ot your site</description>
<files>
<filename plugin="eya">eya.php</filename>
</files>
</install>
<administration >
<filename>admin.php</filename>
</administration>
</extension>
This is my main php file that executes the content:eya.php.
I have got another file (admin.php) that takes 2 session variables from eya.php and put them in an iframe. There are two problems. One is that I dont know if the eya.php runs everytime before admin.php (or at least once to set the session variables). The second problem is that I dont know how to display only the admin.php and nothing else.
to build an admin interface for your plugin just add the config part to your xml
<config>
<fields name="params">
<fieldset name="basic">
<field name="testfield" type="text" default="mytest" label="field_label" description="field_description" />
</fieldset>
</fields>
</config>
but I didn't get the part of your admin.php/eya.php

Multiple themes in plone.app.theming

I am trying to apply a different html (theme) to my front-page (index.html) while all my other pages will have the same theme (index_in.html). I am trying it this way and was wondering why it is not working:
excerpted from my rules.xml:
...
<theme href="index_in.html" css:if-content="#visual-portal-wrapper" />
<rules css:if-content="#visual-portal-wrapper">
<theme href="index.html" if-path="front-page"/>
<theme href="index_in.html" />
...
Thank You
Try...
<rules css:if-content="#visual-portal-wrapper">
<theme href="index.html" if-path="front-page" />
<theme href="index_in.html" />
...
</rules>
If the front page has #visual-portal-wrapper, then the first will match that too and be used. Conditional themes are tried in the order they appear and the first one to match is used.

Resources