Craft CMS Poll plugin v1.3.0
Easily make polls in craft cms
More Craft plugins

Customize the poll entry

In this example, we'll add an image to poll entries. So we can improve the look of our polls with a leader image. You can add any field to your poll entry.


Add an image to the poll entry type

We want our polls to be somewhat fancier, and supply image next to the question.
Since a poll is a regular content type, you can just edit the Poll entry type.
In the CP Settings -> Sections select the Poll entry type to edit:


You can then add your image to the poll:


Create a new poll with an image

When you edit or create a poll now, the UI will look like this and you can add an image:


The twig code to display the image with the poll is obvious,


{% for poll in entry.selectedPoll.all %}
   {% image = poll.image.one ?? null %}
   {# .. code to display the image and the form .. #}
{% endfor %}