I have the following code in my header of a multilingual site. It produces the correct urls in english.
{% for entry in menuentries %}
{% if entry.entryLink.first|length %}
{% set navlink = entry.entryLink.first().uri %}
{% elseif entry.customMenuUrl|length %}
{% set navlink = entry.customMenuUrl %}
{% endif %}
{% if entry.level == 1 and entry.children|length %}
<li class="dropdown">
<a href="{{ siteUrl }}{{ navlink }}" class="dropdown-toggle {{ macros.activeLinkClass(entry.uri, entry.level)|trim }} level{{ entry.level }}" data-toggle="dropdown" role="button" data-hover="dropdown" data-length="{{ entry.title|length }}aria-haspopup="true" aria-expanded="false">{{ entry.title }} <span class="caret"></span></a>
<ul class="dropdown-menu" >
{% for child in entry.getDescendants() %}
<li>
<a href="{{ siteUrl }}{{ child.entryLink.first().uri }}" class="{{ macros.isActiveChildClass(child.slug) | trim }} level{{ child.level }}">{{ child.title }}</a>
</li>
{% endfor %}
</ul>
</li>
{% elseif entry.level == 1 and not entry.hasDescendants() %}
<li>
<a href="{{ siteUrl }}{{ navlink }}" class="{{ macros.activeLinkClass(entry.uri, entry.level) |trim }} level{{ entry.level }}">{{ entry.title }}</a>
</li>
{% endif %}
However when I switch languages eg. to french the child.entryLink.first().uri
returns null. Even if I just change the en
to fr
I get the same result. Bit confused.
entryLink
field enabled for French? – Mats Mikkel Rummelhoff Jul 15 '16 at 8:19