2๐
I did this yesterday.
{% for link in footer_links %}
{% if forloop.first or forloop.counter0|divisibleby:"6" %}
<ul>
{% endif %}
<li><a href='{{ link.href }}'>{{ link.title }}</a></li>
{% if forloop.last or forloop.counter|divisibleby:"6" %}
</ul>
{% endif %}
{% endfor %}
it doesnโt quite do three columns, but it splits the links up into lists of a certain length (6)
๐คGlycerine
0๐
I donโt exactly understand the criteria that is determining your grouping โ is it literally just cycling through by 3? If so, I think that the cycle template tag is what you are looking for:
http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#cycle
๐คjMyles
- [Django]-Django: Lowercasing filename of the input Image File
- [Django]-My custom heroku python buildpack downloads requirements on every push
- [Django]-Django: Stacking decorators
- [Django]-TypeError: f0() takes 1 positional argument but 9 were given
- [Django]-Possible to have multiple Python except statements when using try (without searching for a specific except)?
Source:stackexchange.com