Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Bei individuellen Dropdowns ist das vorgehen ähnlich, lediglich die Werte des Dropdowns müssen zuvor über den Hook "admin_dropdown.php:dropdown" definiert werden und per "url" in der Installations-XML des Plugins verknüpft werden.

1. Option hinzufügen

Code Block
languagexml
<config>
    <key>XT_BESTSELLER_PRODUCTS_SHOW_TYPE</key>
    <type>dropdown</type>
    <value>nothing</value>
    <url>plg_xt_bestseller_products_show_type</url>
    <de>
        <title>Produktauswahl</title>
    </de>
    <en>
        <title>Products to show</title>
    </en>
</config>

 

 

...

2. Dropdown im Hook "admin_dropdown.php:dropdown" hinzufügen

Code Block
languagephp
        <code>
            <hook>admin_dropdown.php:dropdown</hook>
            <phpcode><![CDATA[
               if ($request['get'] == 'plg_xt_bestseller_products_show_type') {
                   if (!isset($result)) $result = array();
                   $result[] = array('id' => 'master', 'name' => XT_BESTSELLER_PRODUCTS_MASTER, 'desc' => XT_BESTSELLER_PRODUCTS_MASTER);
                   $result[] = array('id' => 'slave', 'name' => XT_BESTSELLER_PRODUCTS_SLAVE, 'desc' => XT_BESTSELLER_PRODUCTS_SLAVE);
                   $result[] = array('id' => 'nothing', 'name' => XT_BESTSELLER_PRODUCTS_NOTHING, 'desc' => XT_BESTSELLER_PRODUCTS_NOTHING);
               }]]></phpcode>
            <order>1</order>
            <active>1</active>
        </code>

3. Sprachtexte für die im Dropdown verwendeten Begriffe hinzufügen

Code Block
languagexml
<phrase>
    <key>XT_BESTSELLER_PRODUCTS_MASTER</key>
    <class>admin</class>
    <de>
        <value>Masters + Normal</value>
    </de>
    <en>
        <value>Masters + Normal</value>
    </en>
    <bp>
        <value>Masters + Normal</value>
    </bp>
</phrase>
<phrase>
    <key>XT_BESTSELLER_PRODUCTS_SLAVE</key>
    <class>admin</class>
    <de>
        <value>Slaves + Normal</value>
    </de>
    <en>
        <value>Slaves + Normal</value>
    </en>
    <bp>
        <value>Slaves + Normal</value>
    </bp>
</phrase>
<phrase>
    <key>XT_BESTSELLER_PRODUCTS_NOTHING</key>
    <class>admin</class>
    <de>
        <value>Normal</value>
    </de>
    <en>
        <value>Normal</value>
    </en>
    <bp>
        <value>Normal</value>
    </bp>
</phrase>