问题
Is there a way to detect the last (or first) plugin that has been placed inside a placeholder?
I want to add a class="last" to my plugin template in case of the last plugin.
回答1:
Give this a try:
{% if plugin.last %} This is the last plugin for current placeholder {% endif %}
(plugin.first should also work)
来源:https://stackoverflow.com/questions/5543947/detect-last-plugin-in-a-placeholder