templates/layout/navigation/canvasmenu.html.twig line 1

Open in your IDE?
  1. {% set navmobilepages = build_main_nav(document).pages|filter(page => page.visible) %}
  2. {% set topbarpages = build_property_nav(document, 'navigationTopbar').pages|filter(page => page.visible) %}
  3. {% set userpages = build_property_nav(document, 'navigationUser').pages|filter(page => page.visible) %}
  4. <div class="flex flex-col content-between h-full max-h-[100vh]">
  5. <div class="flex flex-col flex-1 w-full overflow-y-scroll">
  6.   {# Header Menue #}
  7.   {% if localized_links(document, app.request.locale)|length > 1 or app.user %}
  8.   <div class="flex items-center justify-between p-10 pb-0 lg:hidden">
  9.     {# LOGO #}
  10.     <div class="flex items-center justify-around ">
  11.       {% include 'layout/navigation/language.html.twig' %}
  12.     </div>
  13.     <div class="flex items-center space-x-4">
  14.       {# Mobile Menu Button #}
  15.       <div class="w-16 h-16 pt-1">
  16.         {% if app.user %}
  17.           <a class="flex justify-end gap-4 my-2 mb-3 text-xl text-black uppercase"
  18.             href="{{ pimcore_url({ object: app.user }) }}">
  19.             {% include 'component/avatar.html.twig' with {
  20.             avatar: app.user.avatar,
  21.             initials: app.user.name|initials,
  22.             size: 'tiny'
  23.           } only %}
  24.           </a>
  25.         {% endif %}
  26.       </div>
  27.     </div>
  28.   </div>
  29. {% endif %}
  30.   {# Menu Mobile #}
  31.   <div class="flex flex-col px-10 ">
  32.     {# Navigation #}
  33.     <ul class="flex flex-col flex-1 py-6 ">
  34.       {% for page in navmobilepages %}
  35.         <li class="p-2 text-lg text-white border-b border-neutral-800">
  36.           <a class="{{ page.active ? 'font-medium' : '' }}"
  37.             href="{{ page.href }}"
  38.             target="{{ page.target }}">
  39.             {{ page.label|capitalize }}
  40.           </a>
  41.         </li>
  42.       {% endfor %}
  43.       {# Topbar Nav Elements #}
  44.       {% for page in topbarpages %}
  45.         <li class="p-2 text-lg text-white border-b border-neutral-800">
  46.           <a class="{{ page.active ? 'font-medium' : '' }}"
  47.             href="{{ page.href }}"
  48.             target="{{ page.target }}">
  49.             {{ page.label|capitalize }}
  50.           </a>
  51.         </li>
  52.       {% endfor %}
  53.       {% for page in userpages %}
  54.         <li class="p-2 text-lg text-white border-b border-neutral-800">
  55.           <a class="{{ page.active ? 'font-medium' : '' }}"
  56.             href="{{ page.href }}"
  57.             target="{{ page.target }}">
  58.             {{ page.label|capitalize }}
  59.           </a>
  60.         </li>
  61.       {% endfor %}
  62.     </ul>
  63.   </div>
  64. </div>
  65.  {% if app.user %}
  66.       <div class="px-8 py-3 bg-primary">
  67.         {# <a class="flex gap-4 my-2 mb-3 text-xl text-black uppercase"
  68.           href="{{ pimcore_url({ object: app.user }) }}">
  69.           {% include 'component/avatar.html.twig' with {
  70.           avatar: app.user.avatar,
  71.           initials: app.user.name|initials,
  72.           size: 'tiny'
  73.         } only %}
  74.           {{ app.user.name }}
  75.         </a> #}
  76.         <ul class="flex justify-between gap-8 mx-auto text-xl text-black ">
  77.           {# <li>
  78.             <a href="{{ path('profile_messages_index') }}">
  79.               {{ 'navigation.messages'|trans }}
  80.             </a>
  81.           </li> #}
  82.           <li>
  83.             <a class="font-headline text-xs gap-2 grid justify-center items-center justify-items-center {{
  84.               app.request.get('_route') == 'network_activity'
  85.                 ? 'font-medium'
  86.                 : ''
  87.               }}"
  88.               href="{{ path('network_activity') }}">
  89.               <div>{% include "icons/network.svg.twig" with {class: 'w-6 h-6 mt-2'} %}</div>
  90.               <div>{{ 'navigation.my-network'|trans }}</div>
  91.             </a>
  92.           </li>
  93.           {# <li>
  94.             <a href="{{ pimcore_url({ object: app.user }) }}">
  95.               {{ 'navigation.my-profile'|trans }}
  96.             </a>
  97.           </li> #}
  98.           <li>
  99.             <a class=" text-xs gap-2 grid justify-center items-center justify-items-center {{
  100.               app.request.get('_route') == 'profile_admin_index'
  101.                 ? 'font-medium'
  102.                 : ''
  103.               }}"
  104.               href="{{ path('profile_admin_index') }}">
  105.               <div>{% include "icons/edit.svg.twig" with {class: 'w-6 h-6 mt-2'} %}</div>
  106.               <div>{{ 'navigation.manage-profile'|trans }}</div>
  107.             </a>
  108.           </li>
  109.           <li>
  110.             <a class="font-headline text-xs gap-2 grid justify-center items-center justify-items-center {{
  111.               app.request.get('_route') == 'auth_logout'
  112.                 ? 'font-medium'
  113.                 : ''
  114.               }}"
  115.               href="{{ path('auth_logout') }}">
  116.               <div>{% include "icons/logout.svg.twig" with {class: 'w-6 h-6 mt-2'} %}</div>
  117.               <div>{{ 'navigation.logout'|trans }}</div>
  118.             </a>
  119.           </li>
  120.         </ul>
  121.       </div>
  122.     {% else %}
  123.       {# <ul class="pb-6 my-5 mb-6 text-white border-b-2 border-white">
  124.         <li>
  125.           <a class="flex gap-4 my-2 mb-6 text-xl text-black uppercase btn btn-sm btn-white place-items-center"
  126.             href="{{ path('auth_login') }}">
  127.             {% include 'icons/myprofile.svg.twig' with { class: 'h-6 w-6 text-primary -mt-1' } %} {{ 'navigation.login'|trans }}
  128.           </a>
  129.         </li>
  130.         <li>
  131.           <a class="font-headline mx-auto text-xl {{
  132.             app.request.get('_route') == 'auth_register'
  133.               ? 'font-medium'
  134.               : ''
  135.             }}"
  136.             href="{{ path('auth_register') }}">
  137.             {{ 'navigation.register'|trans }}
  138.           </a>
  139.         </li>
  140.       </ul> #}
  141.       <div class="flex-none px-16 py-3 bg-primary">
  142.         {# <a class="flex gap-4 my-2 mb-3 text-xl text-black uppercase"
  143.           href="{{ pimcore_url({ object: app.user }) }}">
  144.           {% include 'component/avatar.html.twig' with {
  145.           avatar: app.user.avatar,
  146.           initials: app.user.name|initials,
  147.           size: 'tiny'
  148.         } only %}
  149.           {{ app.user.name }}
  150.         </a> #}
  151.         <ul class="flex justify-center gap-8 mx-auto text-xl text-black">
  152.           <li>
  153.           <a class="grid items-center justify-center gap-2 text-xs justify-items-center"
  154.             href="{{ path('auth_login') }}">
  155.             {% include 'icons/user.svg.twig' with { class: 'h-6 w-6 text-black -mt-1' } %} {{ 'navigation.login'|trans }}
  156.           </a>
  157.         </li>
  158.  <li>
  159.           <a class="grid items-center justify-center gap-2 text-xs justify-items-center{{
  160.             app.request.get('_route') == 'auth_register'
  161.               ? 'font-medium'
  162.               : ''
  163.             }}"
  164.             href="{{ path('auth_register') }}">
  165.             {% include 'icons/arrow-right.svg.twig' with { class: 'h-6 w-6 text-black -mt-1' } %}
  166.             {{ 'navigation.register'|trans }}
  167.           </a>
  168.         </li>
  169.         </ul>
  170.       </div>
  171.     {% endif %}
  172.     <div class="h-16">
  173.     </div>
  174. </div>