0
votes

Is it possible to loop over the plugins in a placeholder? I want to assign each second plugin another class, so the plugins with an "odd number" appear on the left side and the other on the right sites. Is this possible or do I have to right two different plugins?

1

1 Answers

0
votes

Good question. It's possible to modify the content of a placeholder programmatically, but I don't know of a way to get to the individual plugins. See http://docs.django-cms.org/en/2.1.3/extending_cms/custom_plugins.html#plugin-context-processors for more info on how to write a custom plugin processor.

You could probably use BeautifulSoup to add the classing you need to the HTML in this fashion.

Another option would be to add the classing via JavaScript, but you would have a slight delay from the time the DOM is rendered until the classing is applied.