Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix menu directive #798

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@

{% if node.options.menu == 'mainmenu' %}
{% include "structure/navigation/menu.html.twig" %}
{% elseif node.options.menu == 'sitemap' %}
{% include "body/menu/sitemap.html.twig" %}
{% else %}
<div class="toctree-wrapper compound">
{% if node.caption -%}
<p class="topic-title">{{ renderNode(node.caption) }}</p>
{% elseif node.options['caption'] -%}
<p class="topic-title">{{ node.options['caption'] }}</p>
{% endif -%}
<ul>
{% for entry in node.entries -%}
{% for entry in node.menuEntries -%}
{{ renderNode(entry) }}
{% endfor %}
</ul>
Expand Down
3 changes: 1 addition & 2 deletions tests/Integration/tests-full/breadcrumb/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="page.html">
Page
Expand Down
3 changes: 1 addition & 2 deletions tests/Integration/tests-full/breadcrumb/expected/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class=" current active">
<a href="#" aria-current="page">
Page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="page.html">
Page TYPO3 Extension oauth2 (mfc/oauth2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,14 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class=" active">
<a href="../../Changelog-12.html">
ChangeLog v12
</a> <ul class="menu-level-1"><li class=" active">
<a href="Index.html">
12.0 Changes
</a></li></ul></li> </ul>
<ul class="menu-level-1">
</a></li></ul></li> </ul> <ul class="menu-level-1">
<li class="">
<a href="../../Sitemap.html">
Sitemap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,14 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class=" active">
<a href="../../Changelog-12.html">
ChangeLog v12
</a> <ul class="menu-level-1"><li class=" current active">
<a href="#" aria-current="page">
12.0 Changes
</a></li></ul></li> </ul>
<ul class="menu-level-1">
</a></li></ul></li> </ul> <ul class="menu-level-1">
<li class="">
<a href="../../Sitemap.html">
Sitemap
Expand Down
6 changes: 2 additions & 4 deletions tests/Integration/tests-full/changelog/expected/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,14 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="Changelog-12.html">
ChangeLog v12
</a> <ul class="menu-level-1"><li class="">
<a href="Changelog/12.0/Index.html">
12.0 Changes
</a></li></ul></li> </ul>
<ul class="menu-level-1">
</a></li></ul></li> </ul> <ul class="menu-level-1">
<li class="">
<a href="Sitemap.html">
Sitemap
Expand Down
12 changes: 4 additions & 8 deletions tests/Integration/tests-full/changelog/expected/Sitemap.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,14 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="Changelog-12.html">
ChangeLog v12
</a> <ul class="menu-level-1"><li class="">
<a href="Changelog/12.0/Index.html">
12.0 Changes
</a></li></ul></li> </ul>
<ul class="menu-level-1">
</a></li></ul></li> </ul> <ul class="menu-level-1">
<li class=" current active">
<a href="#" aria-current="page">
Sitemap
Expand Down Expand Up @@ -162,8 +160,7 @@
<h1>Sitemap<a class="headerlink" href="#sitemap" data-bs-toggle="modal" data-bs-target="#linkReferenceModal" title="Reference this headline"><i class="fa-solid fa-paragraph"></i></a></h1>
</section>
<div class="section">

<div class="sitemap">
<div class="sitemap">
<ul>
<li class="toctree-l0">
<a href="Changelog-12.html"
Expand All @@ -174,8 +171,7 @@ <h1>Sitemap<a class="headerlink" href="#sitemap" data-bs-toggle="modal" data-bs-
class="reference internal">
12.0 Changes
</a></li></ul></li> </ul>
</div>
<div class="sitemap">
</div> <div class="sitemap">
<ul>
<li class="toctree-l0">
<a href="#"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="page1.html">
Avatar ViewHelper &lt;be:avatar&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class=" current active">
<a href="#" aria-current="page">
Avatar ViewHelper &lt;be:avatar&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="mainMenu.json.html">
&lt;Unknown&gt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="someDirectory/index.html">
Some Page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="someDirectory/index.html">
Some Page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="someDirectory/index.html">
Some Page
Expand Down
22 changes: 20 additions & 2 deletions tests/Integration/tests-full/menu-subpages/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<p class="caption"><span class="caption-text">This is the toctree</span></p>
<ul class="menu-level-1">
<li class="">
<a href="someDirectory/index.html">
Some Page
Expand Down Expand Up @@ -151,6 +151,7 @@ <h1>Document Title<a class="headerlink" href="#document-title" data-bs-toggle="m
<p>Lorem Ipsum Dolor.</p>

<div class="toctree-wrapper compound">
<p class="topic-title">This is the toctree</p>
<ul class="menu-level">
<li class="toc-item">
<a href="someDirectory/index.html#some-page">Some Page</a>
Expand All @@ -159,6 +160,23 @@ <h1>Document Title<a class="headerlink" href="#document-title" data-bs-toggle="m
</li>
</ul>
</div>
<div class="toctree-wrapper compound">
<p class="topic-title">This is a menu</p>
<ul>
<li class="toc-item">
<a href="someDirectory/index.html#some-page">Some Page</a>
<ul class="menu-level-1">
<li class="toc-item">
<a href="someDirectory/anotherDirectory/index.html#another-page">Another Page</a>


</li>
</ul>

</li>
</ul>
</div>

</section>
<!-- content end -->
</div>
Expand Down
9 changes: 9 additions & 0 deletions tests/Integration/tests-full/menu-subpages/input/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@ Document Title
Lorem Ipsum Dolor.

.. toctree::
:caption: This is the toctree
:glob:
:titlesonly:
:maxdepth: 1

*/index

.. menu::
:caption: This is a menu
:glob:
:titlesonly:
:maxdepth: 2

*/index
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class=" current active">
<a href="#" aria-current="page">
Another Page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="anotherPage.html">
Another Page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="anotherPage.html">
Another Page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="one.html">
One
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="one.html">
One
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="one.html">
One
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class=" current active">
<a href="#" aria-current="page">
One
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="../one.html">
One
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="../one.html">
One
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="../one.html">
One
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="../one.html">
One
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="one.html">
One
Expand Down
3 changes: 1 addition & 2 deletions tests/Integration/tests-full/next-prev/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
</div> <div class="toc-collapse">
<div aria-label="main navigation" class="toc" role="navigation">
<div aria-label="Main navigation" class="main_menu" role="navigation">

<ul class="menu-level-1">
<ul class="menu-level-1">
<li class="">
<a href="page.html">
Page
Expand Down
Loading
Loading