Giter Site home page Giter Site logo

menu-organizer's Introduction

ScandiPWA_MenuOrganizer

This repository is a module for Magento 2. This module is used to create customized navigation.

Menu

  1. Supported features
  2. Installation
  3. How to use
    3.1. Creating first menu
    3.2. Adding menu items
    3.3. Structure for ScandiPWA
    3.4. How to enable/disable menu per store
  4. For development
    4.1. DB structure
    4.2. GraphQl structure
    4.3. Quick file access

1. Supported features

  • Multilevel structured menu
  • Magento categories
  • Magento CMS pages
  • Custom URLs
  • Icons for menu items
  • Custom CSS classes

2. Installation

Installation via composer:

composer require scandipwa/menu-organizer

3. How to use

3.1. Creating first menu

  1. Open admin panel
  2. Locate admin/scandipwa_menuorganizer/menu via URL or by using side panel menu: Scandiweb -> Navigation -> MenuManager
  3. Find Add New Menu button in the right top corner, click it.
  4. Fill out form fields:
    1. Required:
      • Title
      • Menu identifier (used in graphql requests)
      • Menu status (enabled / disabled)
    2. Optional:
      • Custom Menu CSS Class
      • Store (to which store-view this menu is assigned to)
  5. Click Save.

image

3.2. Adding menu items

  1. Open menu.
  2. Find the Assigned Menu Items in the navigation on the left. click it.
  3. Click Add item in the top right corner.
  4. Fill out form fields:
    1. Required:
      • Menu Item Title
      • URL Type (Custom URL / Category / CMS page)
      • URL Type specific field: Custom URL | Category | CMS Page
      • Parent (Parent menu item)
      • Menu Item Status (enabled / disabled)
    2. Optional:
      • Menu Item CSS Class
      • URL Attributes
      • Icon
      • Icon Alt Text
      • Menu Item Sort Order (Item with lowest number will be on top)
  5. Click Save.

image

3.3. Structure for ScandiPWA

By default ScandiPWA will only render yellow elements (check image) and ignore the red ones.

image

The example below would result in a menu with the options Women, Men and Accessories and their respective sub-items (such as Bags and Tops).

image

3.4. How to enable/disable menu per store

To enable a menu for a specific store, make sure you have selected the store in the menu configuration on step 3.1.4.ii.
Then, select the correct menu id in the configuration:

  1. Open admin panel
  2. Using the side panel menu, go to: Stores -> Settings -> Configuration
  3. Find Scope and select the desired store view.
  4. Using the menu dropdown, go to: ScandiPWA -> Content Customization -> Header and Menu
  5. Uncheck the checkbox Use Website
  6. Select the desired menu in Menu to display
  7. Tap Save Config
  8. Flush Cache Storage

image


4. For development

4.1. DB structure

image

4.2. GraphQl structure

type Query {
    scandiwebMenu(identifier: String!): Menu @resolver(class: "ScandiPWA\\MenuOrganizer\\Model\\Resolver\\Menu")
}

type Menu {
    menu_id: ID 
    title: String 
    is_active: Boolean 
    css_class: String 
    items: [Item]
}

type Item  {
    item_id: ID 
    icon: String
    title: String 
    item_class: String @doc(description: "CSS class of the item")
    parent_id: Int 
    url: String 
    url_type: Int @doc(description: "0 - regular link, 1 - cms page, 2 - category")
    position: Int 
    is_active: Boolean 
    cms_page_identifier: String 
    is_promo: Int @doc(description: "Boolean if category is promotional category")
    promo_image: String @doc(description: "Promo category image background")
    category_id: Int @doc(description: "Category id")
}

Or check: schema.graphqls

4.3. Quick file access:

menu-organizer's People

Contributors

ainarssondors avatar aleksandrskondratjevs avatar alfredsgenkins avatar andrii-antoniuk avatar atravkovs avatar carinadues avatar denisprotassoff avatar dfelton avatar edgars1337 avatar ernestsverins avatar mihailspopovs4 avatar riha112 avatar rut4 avatar winniepukki avatar ybutrameev avatar zans-laksa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.