I'm attempting to modify the language switcher links in a block so that the items are properly nested per my site's menu structure.
Currently, it outputs:
<ul>
<li>English Link</li>
<li>Japanese Link</li>
<li>Spanish Link</li>
</ul>
I need:
<ul>
<li>English Link</li>
<ul>
<li>Japanese Link</li>
<li>Spanish Link</li>
</ul>
</ul>
The $build['content']['#links']
array contains:
array (size=4)
'en' =>
array (size=5)
'url' =>
object(Drupal\Core\Url)[14062]
...
'ja' =>
array (size=5)
'url' =>
object(Drupal\Core\Url)[14062]
How can I modify this array so that elements are nested in a ul
under the first link?