0

I want to admin user can able to do module enable disable from back end,

Its reflecting but doesn't worked. Please help. below is my 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>
        <tab id="Satish" translate="label" sortOrder="10">
            <label>Satish</label>
        </tab>
        <section id="Socialshare" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Social Share Footer</label>
            <tab>Satish</tab>
            <resource>Satish_Socialshare::Socialshare_config</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>General Configuration</label>
                <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Module Enable</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                    <label>Display Text</label>
                    <comment>This text will display on the frontend.</comment>
                </field>
            </group>
        </section>
    </system>
</config>
6
  • You mean to say, dropdonw display in admin area, but when you select No, your module not disable ?
    – user55548
    Commented Mar 7, 2019 at 12:26
  • yes when I select Yes/No for enable disable its not working.. I made one basic module just wanted to do change status from back end.
    – Mahendra
    Commented Mar 7, 2019 at 12:28
  • explain briefly
    – user68317
    Commented Mar 7, 2019 at 12:29
  • If you put dropdown for yes/no and you select no, it does not mean your module disable. You have to write code for disable module as per this dropdonw value
    – user55548
    Commented Mar 7, 2019 at 12:30
  • You need to check this dropdown value before your module code execution. It might be more then on place you have to add condition for check dropdonw value. It's depend on your module.
    – user55548
    Commented Mar 7, 2019 at 12:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.