Skip to content

Commit 294ecfe

Browse files
authored
Merge pull request #51 from zorexsalvo/main
Support external URLs in parent navigation items
2 parents ec34d86 + ba5328c commit 294ecfe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/home/templates/home/components/navbar.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,14 @@
8888

8989
{% for item in navigation_items %}
9090
<li class="relative group">
91+
{% if item.external_url %}
92+
<a href="{{ item.external_url }}" class="menu-nav font-bantayog text-xl text-brown-1 font-light hover:text-orange-2 cursor-pointer">
93+
{{ item }}
94+
</a>
95+
{% else %}
9196
<button class="menu-nav font-bantayog text-xl text-brown-1 font-light hover:text-orange-2 cursor-pointer">
9297
{{ item }}
98+
{% if item.has_children %}
9399
<svg width="16" height="16" viewBox="0 0 24 24" fill="none"
94100
xmlns="http://www.w3.org/2000/svg">
95101
<path d="M6 9L12 15L18 9"
@@ -98,7 +104,10 @@
98104
stroke-linecap="round"
99105
stroke-linejoin="round"/>
100106
</svg>
107+
{% endif %}
101108
</button>
109+
{% endif %}
110+
{% if item.has_children %}
102111
<ul class="absolute left-0 top-full p-1 mt-2 w-52 bg-base-100 rounded-box shadow opacity-0 invisible
103112
group-hover:opacity-100 group-hover:visible transition-all duration-150 z-[1]">
104113
{% for child in item.children.all %}
@@ -110,6 +119,7 @@
110119
</li>
111120
{% endfor %}
112121
</ul>
122+
{% endif %}
113123
</li>
114124
{% endfor %}
115125

0 commit comments

Comments
 (0)