EN IT
Open2b version 7.8

Add more levels to the department menu

In the Respy Wide template, departments are shown in the left menu with two levels: top departments and their sub-departments. Below is how to show more levels.

Before you proceed

Changing template source code requires some knowledge of HTML and CSS.

Note

The changes described here apply to the original Respy Wide template. If you have a modified Respy template or use another custom template, the instructions may be slightly different.

Add one or more levels to the department menu

  1. Go to the Website section of the back office.
  2. Go to the Design subsection.
  3. Click Customize next to the template to edit. The Template Editor will open.
  4. Click HTML and CSS.
  5. Click partials and then navigation.html. The file source will open in the center of the page.
  6. Find the following line:
    <li>{{ dep.Name }}</li>

    and replace it with the following:

    <li>
      {% if dep.ChildDepartments %}
      <a href="{{ dep.Name.URL }}" data-design-open>{{ dep.Name.Text }}</a>
      <ul class="children">
        {% for dep in dep.ChildDepartments %}
        <li>{{ dep.Name %}</li>
        {% end for %}
      </ul>
      {% else %}
        {{ dep.Name }}
      {% end if %}
    </li>
  7. If you want to add more levels, repeat from step 6.
  8. From the Save... menu at the top, select Save to save the file.
  9. Click the monitor icon at the top left to see the changes. If it looks correct, click Save at the bottom left.