0

I have breadcrumbs block that I want to have displayVersion as a first list item or componentVersion if the displayVersion is not available.

The current code is like that:

<nav class="breadcrumbs" aria-label="breadcrumbs">
  {{#if page.breadcrumbs}}
  <ul>
  <li>{{./componentVersion}}</li>
{{/if~}}
  </li>
    {{#with page.componentVersion}}
    {{#if (and ./title (ne ./title @root.page.breadcrumbs.0.content))}}
    <li><a href="{{{relativize ./url}}}">{{{./title}}}</a></li>
    {{/if}}
    {{/with}}
    {{#each page.breadcrumbs}}
    <li>
    {{~#if (and ./url (eq ./urlType 'internal'))~}}
    <a href="{{{relativize ./url}}}">{{{./content}}}</a>
    {{~else~}}
    {{{./content}}}
    {{~/if~}}
    </li>
    {{/each}}
  </ul>
  {{/if}}
</nav>

I want the first <li> to look like this:

  {{~#if (./displayVersion)}}
  <li>{{./displayVersion}}</li>
  {{else}}
  <li>{{./componentVersion}}</li>

Is something like this possible?

Vladimir Markiev
  • 263
  • 1
  • 13

0 Answers0