Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joshine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
joshine
Commits
3a34c456
Commit
3a34c456
authored
Feb 11, 2023
by
halweg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 图片上传完成
parent
088b3c6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
app/code/Joshine/Category/Block/Html/Topmenu.php
+21
-8
app/code/Joshine/Category/Plugin/Block/Topmenu.php
+2
-0
No files found.
app/code/Joshine/Category/Block/Html/Topmenu.php
View file @
3a34c456
...
@@ -194,16 +194,13 @@ class Topmenu extends JoshineMenu
...
@@ -194,16 +194,13 @@ class Topmenu extends JoshineMenu
$sumMenuColumnsTotal
=
$child
->
getSubmenuColumnsTotal
();
$sumMenuColumnsTotal
=
$child
->
getSubmenuColumnsTotal
();
$columns
=
$sumMenuColumnsTotal
??
'12'
;
$columns
=
$sumMenuColumnsTotal
??
'12'
;
if
(
$childLevel
==
0
)
{
if
(
$childLevel
==
0
)
{
$html
=
"<div class=
\"
level
{
$childLevel
}
{
$childrenWrapClass
}
\"
>"
;
$html
=
"<div class=
\"
level
{
$childLevel
}
{
$childrenWrapClass
}
\"
>"
;
$html
.=
"<div class=
\"
row
\"
>
$html
.=
"<div class=
\"
row
\"
>
<ul class=
\"
subchildmenu mega-columns joshine-clearfix joshine-col-lg-
{
$columns
}
\"
>
<ul class=
\"
subchildmenu mega-columns joshine-clearfix joshine-col-lg-
{
$columns
}
{
$child
->
getMenuImage
()
}
\"
>
{
$this
->
_getHtml
(
$child
,
$childrenWrapClass
,
$limit
,
$colStops
)
}
{
$this
->
_getHtml
(
$child
,
$childrenWrapClass
,
$limit
,
$colStops
)
}
</ul>
</ul>"
;
<div class=
\"
pull-right
\"
>"
.
$html
.=
$this
->
appendImage
(
$child
);
" "
//$this->getLayout()->createBlock(\Magento\Cms\Block\Block::class)->setBlockId('catpic')
$html
.=
"</div></div>"
;
.
"</div>
</div>
</div>"
;
}
else
{
}
else
{
$html
.=
'<ul class="level'
.
$childLevel
.
'">'
;
$html
.=
'<ul class="level'
.
$childLevel
.
'">'
;
$html
.=
$this
->
_getHtml
(
$child
,
$childrenWrapClass
,
$limit
,
$colStops
);
$html
.=
$this
->
_getHtml
(
$child
,
$childrenWrapClass
,
$limit
,
$colStops
);
...
@@ -212,4 +209,20 @@ class Topmenu extends JoshineMenu
...
@@ -212,4 +209,20 @@ class Topmenu extends JoshineMenu
return
$html
;
return
$html
;
}
}
private
function
appendImage
(
$child
)
{
$html
=
""
;
if
(
!
$child
->
getMenuImage
())
{
return
$html
;
}
if
(
$child
->
getMenuImage
())
{
$html
.=
"<div class=
\"
pull-right
\"
>"
;
$html
.=
"<img src='
{
$child
->
getMenuImage
()
}
'/>"
;
$html
.=
"</div>"
;
}
return
$html
;
}
}
}
app/code/Joshine/Category/Plugin/Block/Topmenu.php
View file @
3a34c456
...
@@ -148,6 +148,7 @@ class Topmenu extends Menu
...
@@ -148,6 +148,7 @@ class Topmenu extends Menu
'submenu_columns_total'
=>
$category
->
getData
(
'submenu_columns_total'
),
'submenu_columns_total'
=>
$category
->
getData
(
'submenu_columns_total'
),
'self_columns'
=>
$category
->
getData
(
'self_columns'
),
'self_columns'
=>
$category
->
getData
(
'self_columns'
),
'submenu_columns_single'
=>
$category
->
getData
(
'submenu_columns_single'
),
'submenu_columns_single'
=>
$category
->
getData
(
'submenu_columns_single'
),
'menu_image'
=>
$category
->
getData
(
'menu_image'
),
'has_active'
=>
in_array
((
string
)
$categoryId
,
explode
(
'/'
,
(
string
)
$currentCategory
->
getPath
()),
true
),
'has_active'
=>
in_array
((
string
)
$categoryId
,
explode
(
'/'
,
(
string
)
$currentCategory
->
getPath
()),
true
),
'is_active'
=>
$categoryId
==
$currentCategory
->
getId
(),
'is_active'
=>
$categoryId
==
$currentCategory
->
getId
(),
'is_category'
=>
true
,
'is_category'
=>
true
,
...
@@ -175,6 +176,7 @@ class Topmenu extends Menu
...
@@ -175,6 +176,7 @@ class Topmenu extends Menu
$collection
->
addAttributeToSelect
(
'submenu_columns_total'
);
$collection
->
addAttributeToSelect
(
'submenu_columns_total'
);
$collection
->
addAttributeToSelect
(
'submenu_columns_single'
);
$collection
->
addAttributeToSelect
(
'submenu_columns_single'
);
$collection
->
addAttributeToSelect
(
'self_columns'
);
$collection
->
addAttributeToSelect
(
'self_columns'
);
$collection
->
addAttributeToSelect
(
'menu_image'
);
$collection
->
addFieldToFilter
(
'path'
,
[
'like'
=>
'1/'
.
$rootId
.
'/%'
]);
//load only from store root
$collection
->
addFieldToFilter
(
'path'
,
[
'like'
=>
'1/'
.
$rootId
.
'/%'
]);
//load only from store root
$collection
->
addAttributeToFilter
(
'include_in_menu'
,
1
);
$collection
->
addAttributeToFilter
(
'include_in_menu'
,
1
);
$collection
->
addIsActiveFilter
();
$collection
->
addIsActiveFilter
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment