-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update Twig navigation to allow parameters (#147)
* refactor: update Twig navigation to allow parameters Navigation was still using the deprecated buildNavigation method. In addition, it was impossible to configure custom parameters, which is possible when you use the Pimcore build_nav Twig function. The logic was refactored to work similar to the Pimcore build_nav. The old deprecated setup still works, but parameters can (and should) be used now. In addition, when configuring the pageCallback parameter, it is now called within the members callback, which also forwards the restriction element, allowing you to override the restriction settings and apply other logic. * [test] add restricted navigation tests
- Loading branch information
1 parent
6e9081c
commit f3ede63
Showing
8 changed files
with
331 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Test Page for Members</title> | ||
</head> | ||
<body> | ||
<div id="site"> | ||
{% block content %} | ||
|
||
<div class="nav"> | ||
|
||
{% set nav = members_build_nav({ | ||
active: pimcore_document(1), | ||
root: pimcore_document(1) | ||
}) %} | ||
|
||
{{ pimcore_render_nav(nav, 'menu', 'renderMenu', { maxDepth: 2 }) }} | ||
</div> | ||
|
||
<div class="legacy-nav"> | ||
{% set nav2 = members_build_nav(pimcore_document(1), pimcore_document(1), null, true) %} | ||
{{ pimcore_render_nav(nav2, 'menu', 'renderMenu', { maxDepth: 2 }) }} | ||
</div> | ||
|
||
{% endblock %} | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.