custom/plugins/ImnxxLandingpageNavi/src/ImnxxLandingpageNavi.php line 11

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace ImnxxLandingpageNavi;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  5. use Shopware\Core\System\CustomField\CustomFieldTypes;
  6. use Shopware\Core\Framework\Uuid\Uuid;
  7. class ImnxxLandingpageNavi extends Plugin
  8. {
  9.     public function install(InstallContext $installContext): void
  10.     {
  11.         $customFieldSetRepository $this->container->get('custom_field_set.repository');
  12.         $customFieldSetRepository->create([
  13.             [
  14.                 'name' => 'imnxx_landingpage_navi',
  15.                 'config' => [
  16.                     'label' => [
  17.                         'de-DE' => 'LP Navigation'
  18.                     ]
  19.                 ],
  20.                 'customFields' => [
  21.                     [
  22.                         'name' => 'imnxx_landingpage_navi_show',
  23.                         'type' => CustomFieldTypes::SWITCH,
  24.                         'config' => [
  25.                             'label' => [
  26.                                 'de-DE' => 'Navigation anzeigen (imnxx_landingpage_navi_show)'
  27.                             ],
  28.                             'type' => 'switch',
  29.                             'customFieldType' => 'switch',
  30.                             'customFieldPosition' => 0
  31.                         ]
  32.                     ],
  33.                     [
  34.                         'name' => 'imnxx_landingpage_navi_hightlight_background',
  35.                         'type' => CustomFieldTypes::COLORPICKER,
  36.                         'config' => [
  37.                             'label' => [
  38.                                 'de-DE' => 'Highlight Hintergrundfarbe für diese Kategorie (imnxx_landingpage_navi_hightlight_background)'
  39.                             ],
  40.                             'type' => 'colorpicker',
  41.                             'customFieldType' => 'colorpicker',
  42.                             'customFieldPosition' => 1
  43.                         ]
  44.                     ],
  45.                     [
  46.                         'name' => 'imnxx_landingpage_navi_hightlight_color',
  47.                         'type' => CustomFieldTypes::COLORPICKER,
  48.                         'config' => [
  49.                             'label' => [
  50.                                 'de-DE' => 'Highlight Schriftfarbe für diese Kategorie (imnxx_landingpage_navi_hightlight_color)'
  51.                             ],
  52.                             'type' => 'colorpicker',
  53.                             'customFieldType' => 'colorpicker',
  54.                             'customFieldPosition' => 1
  55.                         ]
  56.                     ],
  57.                     [
  58.                         'name' => 'imnxx_landingpage_navi_header_img',
  59.                         'type' => CustomFieldTypes::MEDIA,
  60.                         'config' => [
  61.                             'label' => [
  62.                                 'de-DE' => 'Header Bild (imnxx_landingpage_navi_header_img)'
  63.                             ],
  64.                             'type' => 'media',
  65.                             'customFieldType' => 'media',
  66.                             'componentName' => 'sw-media-field',
  67.                             'customFieldPosition' => 2
  68.                         ]
  69.                     ],
  70.                     [
  71.                         'name' => 'imnxx_landingpage_navi_header_img_tablet',
  72.                         'type' => CustomFieldTypes::MEDIA,
  73.                         'config' => [
  74.                             'label' => [
  75.                                 'de-DE' => 'Header Bild Tablet (imnxx_landingpage_navi_header_img_tablet)'
  76.                             ],
  77.                             'type' => 'media',
  78.                             'customFieldType' => 'media',
  79.                             'componentName' => 'sw-media-field',
  80.                             'customFieldPosition' => 3
  81.                         ]
  82.                     ],
  83.                     [
  84.                         'name' => 'imnxx_landingpage_navi_header_img_mobile',
  85.                         'type' => CustomFieldTypes::MEDIA,
  86.                         'config' => [
  87.                             'label' => [
  88.                                 'de-DE' => 'Header Bild Mobile (imnxx_landingpage_navi_header_img_mobile)'
  89.                             ],
  90.                             'type' => 'media',
  91.                             'customFieldType' => 'media',
  92.                             'componentName' => 'sw-media-field',
  93.                             'customFieldPosition' => 4
  94.                         ]
  95.                     ],
  96.                     [
  97.                         'name' => 'imnxx_landingpage_navi_header_img_url',
  98.                         'type' => CustomFieldTypes::TEXT,
  99.                         'config' => [
  100.                             'label' => [
  101.                                 'de-DE' => 'Header Bild URL (imnxx_landingpage_navi_header_img_url)'
  102.                             ],
  103.                             'type' => 'text',
  104.                             'customFieldType' => 'text',
  105.                             'componentName' => 'sw-media-field',
  106.                             'customFieldPosition' => 5
  107.                         ]
  108.                     ],
  109.                     [
  110.                         'name' => 'imnxx_landingpage_navi_background',
  111.                         'type' => CustomFieldTypes::COLORPICKER,
  112.                         'config' => [
  113.                             'label' => [
  114.                                 'de-DE' => 'Navigation Background Farbe (imnxx_landingpage_navi_background)'
  115.                             ],
  116.                             'type' => 'colorpicker',
  117.                             'customFieldType' => 'colorpicker',
  118.                             'customFieldPosition' => 6
  119.                         ]
  120.                     ],
  121.                     [
  122.                         'name' => 'imnxx_landingpage_navi_hover_background',
  123.                         'type' => CustomFieldTypes::COLORPICKER,
  124.                         'config' => [
  125.                             'label' => [
  126.                                 'de-DE' => 'Navigation Background Farbe beim hover (imnxx_landingpage_navi_hover_background)'
  127.                             ],
  128.                             'type' => 'colorpicker',
  129.                             'customFieldType' => 'colorpicker',
  130.                             'customFieldPosition' => 7
  131.                         ]
  132.                     ],
  133.                     [
  134.                         'name' => 'imnxx_landingpage_navi_color',
  135.                         'type' => CustomFieldTypes::COLORPICKER,
  136.                         'config' => [
  137.                             'label' => [
  138.                                 'de-DE' => 'Navigation Text Farbe (imnxx_landingpage_navi_color)'
  139.                             ],
  140.                             'type' => 'colorpicker',
  141.                             'customFieldType' => 'colorpicker',
  142.                             'customFieldPosition' => 8
  143.                         ]
  144.                     ],
  145.                     [
  146.                         'name' => 'imnxx_landingpage_navi_hover_color',
  147.                         'type' => CustomFieldTypes::COLORPICKER,
  148.                         'config' => [
  149.                             'label' => [
  150.                                 'de-DE' => 'Navigation Text Farbe beim hover (imnxx_landingpage_navi_hover_color)'
  151.                             ],
  152.                             'type' => 'colorpicker',
  153.                             'customFieldType' => 'colorpicker',
  154.                             'customFieldPosition' => 9
  155.                         ]
  156.                     ],
  157.                     [
  158.                         'name' => 'imnxx_landingpage_navi_font_family',
  159.                         'type' => CustomFieldTypes::TEXT,
  160.                         'config' => [
  161.                             'label' => [
  162.                                 'de-DE' => 'Navigation font family (imnxx_landingpage_navi_font_family)'
  163.                             ],
  164.                             'type' => 'text',
  165.                             'customFieldType' => 'text',
  166.                             'customFieldPosition' => 10
  167.                         ]
  168.                     ],
  169.                     [
  170.                         'name' => 'imnxx_landingpage_navi_font_size',
  171.                         'type' => CustomFieldTypes::NUMBER,
  172.                         'config' => [
  173.                             'label' => [
  174.                                 'de-DE' => 'Navigation font size in px (imnxx_landingpage_navi_font_size)'
  175.                             ],
  176.                             'type' => 'number',
  177.                             'customFieldType' => 'number',
  178.                             'customFieldPosition' => 11
  179.                         ]
  180.                     ],
  181.                     [
  182.                         'name' => 'imnxx_landingpage_navi_font_weight',
  183.                         'type' => CustomFieldTypes::SELECT,
  184.                         'config' => [
  185.                             'label' => [
  186.                                 'de-DE' => 'Navigation font weight (imnxx_landingpage_navi_font_weight)'
  187.                             ],
  188.                             'type' => 'select',
  189.                             'customFieldType' => 'select',
  190.                             'customFieldPosition' => 12,
  191.                             'options' => [
  192.                                 [
  193.                                     'label' => ['de-DE' => 'normal'],
  194.                                     'value' => 'normal'
  195.                                 ],
  196.                                 [
  197.                                     'label' => ['de-DE' => 'lighter'],
  198.                                     'value' => 'lighter'
  199.                                 ],
  200.                                 [
  201.                                     'label' => ['de-DE' => 'bold'],
  202.                                     'value' => 'bold'
  203.                                 ]
  204.                             ]
  205.                         ]
  206.                     ],
  207.                     [
  208.                         'name' => 'imnxx_landingpage_navi_logo',
  209.                         'type' => CustomFieldTypes::MEDIA,
  210.                         'config' => [
  211.                             'label' => [
  212.                                 'de-DE' => 'Logo (imnxx_landingpage_navi_logo)'
  213.                             ],
  214.                             'type' => 'media',
  215.                             'customFieldType' => 'media',
  216.                             'componentName' => 'sw-media-field',
  217.                             'customFieldPosition' => 13
  218.                         ]
  219.                     ],
  220.                     [
  221.                         'name' => 'imnxx_landingpage_navi_logo_height',
  222.                         'type' => CustomFieldTypes::TEXT,
  223.                         'config' => [
  224.                             'label' => [
  225.                                 'de-DE' => 'Logo Höhe in px (imnxx_landingpage_navi_logo_height)'
  226.                             ],
  227.                             'type' => 'text',
  228.                             'customFieldType' => 'text',
  229.                             'componentName' => 'sw-media-field',
  230.                             'customFieldPosition' => 14
  231.                         ]
  232.                     ],
  233.                     [
  234.                         'name' => 'imnxx_landingpage_navi_logo_url',
  235.                         'type' => CustomFieldTypes::TEXT,
  236.                         'config' => [
  237.                             'label' => [
  238.                                 'de-DE' => 'Logo URL (imnxx_landingpage_navi_logo_url)'
  239.                             ],
  240.                             'type' => 'text',
  241.                             'customFieldType' => 'text',
  242.                             'componentName' => 'sw-media-field',
  243.                             'customFieldPosition' => 15
  244.                         ]
  245.                     ],
  246.                     [
  247.                         'name' => 'imnxx_landingpage_navi_flowing_text_font_family',
  248.                         'type' => CustomFieldTypes::TEXT,
  249.                         'config' => [
  250.                             'label' => [
  251.                                 'de-DE' => 'Fließtext font family (imnxx_landingpage_navi_flowing_text_font_family)'
  252.                             ],
  253.                             'type' => 'text',
  254.                             'customFieldType' => 'text',
  255.                             'componentName' => 'sw-media-field',
  256.                             'customFieldPosition' => 16
  257.                         ]
  258.                     ],
  259.                     [
  260.                         'name' => 'imnxx_landingpage_navi_padding',
  261.                         'type' => CustomFieldTypes::TEXT,
  262.                         'config' => [
  263.                             'label' => [
  264.                                 'de-DE' => 'Navi Innenabstand - Padding (imnxx_landingpage_navi_padding)'
  265.                             ],
  266.                             'helpText' => [
  267.                                 'de-DE' => 'Vier Zahlen (Oben, Rechts, Unten, Links), zwei (Vertikal, Horizontal) oder nur eine (in alle 4 Richtungen). Jeweils mit px oder rem. Ohne Angabe bei "1rem 0".'
  268.                             ],
  269.                             'type' => 'text',
  270.                             'customFieldType' => 'text',
  271.                             'componentName' => 'sw-media-field',
  272.                             'customFieldPosition' => 17
  273.                         ]
  274.                     ],
  275.                     [
  276.                         'name' => 'imnxx_landingpage_navi_menu_margin',
  277.                         'type' => CustomFieldTypes::TEXT,
  278.                         'config' => [
  279.                             'label' => [
  280.                                 'de-DE' => 'Menü Abstand nach unten - margin-bottom (imnxx_landingpage_navi_menu_margin)'
  281.                             ],
  282.                             'helpText' => [
  283.                                 'de-DE' => 'Kommt zu dem Navi Innenabstand dazu. Angabe mit px oder rem.'
  284.                             ],
  285.                             'type' => 'text',
  286.                             'customFieldType' => 'text',
  287.                             'componentName' => 'sw-media-field',
  288.                             'customFieldPosition' => 17
  289.                         ]
  290.                     ]
  291.                 ],
  292.                 'relations' => [
  293.                     [
  294. //                        'id' => Uuid::randomHex(),
  295.                         'entityName' => 'category'
  296.                     ]
  297.                 ]
  298.             ]
  299.         ], $installContext->getContext());
  300.     }
  301. }