Hi.
I would like to display three social icon elements divided into two columns with a for statement.
The HTML output should look like this:
<ul class = "divided icons col-6 col-12-mobile">
<li class = "icon brands fa-twitter"> <a href="#"> <span class = "extra"> twitter.com/ </span> untitled </a> </li>
<li class = "icon brands fa-facebook-f"> <a href="#"> <span class = "extra"> facebook.com/ </span> untitled </a> </li>
<li class = "icon brands fa-dribbble"> <a href="#"> <span class = "extra"> dribbble.com/ </span> untitled </a> </li>
</ul>
<ul class = "divided icons col-6 col-12-mobile">
<li class = "icon brands fa-instagram"> <a href="#"> <span class = "extra"> instagram.com/ </span> untitled </a> </li>
<li class = "icon brands fa-youtube"> <a href="#"> <span class = "extra"> youtube.com/ </span> untitled </a> </li>
<li class = "icon brands fa-pinterest"> <a href="#"> <span class = "extra"> pinterest.com/ </span> untitled </a> </li>
</ul>
The css class 'divided' is the one that delimits each row with a line below.
In the twig file I have the following code:
<ul class = "divided icons col-6 col-12-mobile">
{% for item in theme_config.social%}
<li class = "icon brands fa - {{item.icon}}"> <a href="[[ item.url }-lex.europa.eu"> <span class = "extra"> {{item.name}} </ a > </li>
{% endfor%}
</ul>
With this code I would apply the class 'divided' to a single column, and my goal is to make it appear as in the HTML code shown.
How could I do it with a for loop and slice?
Thanks