File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Webgriffe \BootstrapMenu \View \Element \Html \Link ;
4
+
5
+ class Current extends \Magento \Framework \View \Element \Html \Link \Current
6
+ {
7
+ protected function _toHtml ()
8
+ {
9
+ if (false != $ this ->getTemplate ()) {
10
+ return parent ::_toHtml ();
11
+ }
12
+
13
+ $ highlight = '' ;
14
+
15
+ if ($ this ->getIsHighlighted () || $ this ->isCurrent ()) {
16
+ $ highlight = ' active ' ;
17
+ }
18
+
19
+ $ html = '<li class="nav item ' . $ highlight . '"><a href=" ' . $ this ->escapeHtml ($ this ->getHref ()) . '" ' ;
20
+ $ html .= $ this ->getTitle ()
21
+ ? ' title=" ' . $ this ->escapeHtml ((string )new \Magento \Framework \Phrase ($ this ->getTitle ())) . '" '
22
+ : '' ;
23
+ $ html .= $ this ->getAttributesHtml () . '> ' ;
24
+
25
+ if ($ this ->getIsHighlighted ()) {
26
+ $ html .= '<strong> ' ;
27
+ }
28
+
29
+ $ html .= $ this ->escapeHtml ((string )new \Magento \Framework \Phrase ($ this ->getLabel ()));
30
+
31
+ if ($ this ->getIsHighlighted ()) {
32
+ $ html .= '</strong> ' ;
33
+ }
34
+
35
+ $ html .= '</a></li> ' ;
36
+
37
+ return $ html ;
38
+ }
39
+ }
Original file line number Diff line number Diff line change 2
2
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
3
xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
4
4
<preference for =" Magento\Theme\Block\Html\Topmenu" type =" Webgriffe\BootstrapMenu\Block\Html\Topmenu" />
5
+ <preference for =" Magento\Framework\View\Element\Html\Link\Current" type =" Webgriffe\BootstrapMenu\View\Element\Html\Link\Current" />
5
6
</config >
You can’t perform that action at this time.
0 commit comments