diff --git a/src/Component/Navbar/Navbar.php b/src/Component/Navbar/Navbar.php index 6208276..9ac3992 100644 --- a/src/Component/Navbar/Navbar.php +++ b/src/Component/Navbar/Navbar.php @@ -12,5 +12,32 @@ public function init() { // Extract array for eazy access (fetch only) extract($this->data); + + if($this->data['isDynamic']) { + + + $this->data['attributeList']['js-is-dynamic'] = ''; + + if(isset($childItemsUrl)) { + + + $this->data['attributeList']['js-child-items-url'] = $childItemsUrl; + } + } + + if(isset($this->data['multiDimenexpanded_menusional'])) { + foreach($this->data['expanded_menu'] as $key => $value){ + $this->data['expanded_menu'][$key]['id'] = isset($this->data['expanded_menu'][$key]['id']) ? $this->data['expanded_menu'][$key]['id'] : null; + } + } + + if(isset($this->data['pageID'])) { + $this->data['attributeList']['data-page-id'] = $this->data['pageID']; + } + + if(isset($this->data['pageParentID'])) { + $this->data['attributeList']['data-page-parent-id'] = $this->data['pageParentID']; + } + } } diff --git a/src/Component/Navbar/navbar.json b/src/Component/Navbar/navbar.json index b01c526..4e4ac41 100644 --- a/src/Component/Navbar/navbar.json +++ b/src/Component/Navbar/navbar.json @@ -4,7 +4,8 @@ "logo": "", "items": [], "sidebar": false, - "expanded_menu": false + "expanded_menu": false, + "isDynamic": false }, "description":{ diff --git a/src/Component/Navbar/sub/expanded_grid.blade.php b/src/Component/Navbar/sub/expanded_grid.blade.php index d648fc5..eacc16a 100644 --- a/src/Component/Navbar/sub/expanded_grid.blade.php +++ b/src/Component/Navbar/sub/expanded_grid.blade.php @@ -1,3 +1,5 @@ + + @grid([ "classList" => [ $baseClass.'__expanded_grid' @@ -8,8 +10,9 @@ "col_gap" => "5", "row_gap" => "9" ]) - + @foreach ($expanded_menu as $key => $item) + @grid([ 'element' => 'a', 'classList' => [ @@ -38,4 +41,5 @@ @endgrid @endforeach + @endgrid \ No newline at end of file diff --git a/src/Component/Navbar/sub/expanded_main.blade.php b/src/Component/Navbar/sub/expanded_main.blade.php index 6558ed1..816b01b 100644 --- a/src/Component/Navbar/sub/expanded_main.blade.php +++ b/src/Component/Navbar/sub/expanded_main.blade.php @@ -7,13 +7,14 @@ 'color' => 'default', 'size' => 'lg', 'style' => 'basic', + 'href' => '#', 'classList' => [ $baseClass.'__prev' ] ]) @endbutton @endif - + @typography([ "element" => "h2", "variant" => "marketing", diff --git a/src/Component/Navbar/sub/expanded_menu.blade.php b/src/Component/Navbar/sub/expanded_menu.blade.php index f01280e..23e20fe 100644 --- a/src/Component/Navbar/sub/expanded_menu.blade.php +++ b/src/Component/Navbar/sub/expanded_menu.blade.php @@ -7,13 +7,15 @@ "col_gap" => "4" ]) - @foreach ($expanded_menu as $key => $item) - @grid([]) - @link([ - 'href' => $item['href'] - ]) - {{$key}} - @endbutton - @endgrid - @endforeach + @if(!$isDynamic) + @foreach ($expanded_menu as $key => $item) + @grid([]) + @link([ + 'href' => $item['href'] + ]) + {{$key}} + @endbutton + @endgrid + @endforeach + @endif @endgrid \ No newline at end of file