Polls Documentation

Default Poll HTML

This is the default style HTML for polls. Use it as a reference when customizing to fit your needs.

{exp:polls:poll poll_id="your_poll_id"}
<div id="poll-{poll_id}" class="poll">
    {if poll_is_open}

        <h1>{poll_question}</h1>

        {poll_form_errors}

        {poll_form}
            <ul class="answers">
                {poll_options}
                    <li class="option">
                        {if poll_show_vote}
                            <div class="radio">{option_input}</div>
                            <label>- {option_label}</label>
                            {if option_is_other}
                                <div class="textfield">{option_input_other}</div>
                            {/if}
                        {if:elseif poll_show_results}
                            <div class="option-value">{option_value}</div>
                            <div class="option-detail">
                                <div class="vote-count">{option_votes} votes</div>
                                <div class="vote-ratio">{option_ratio}%</div>
                            </div>
                            <div class="option-bar"><div class="option-bar-value" style="width:{option_ratio}%;"></div></div>
                        {/if}
                    </li>
                {/poll_options}
            </ul>

            {if poll_show_vote}
                <div class="buttons">
                    <div class="cast-vote">{poll_form_submit}</div>
                    <div class="view-results">{poll_view_results}</div>
                </div>
            {if:else}
                <div class="poll-detail">
                    {if poll_limit_votes AND has_voted}
                        <p>Thank you for voting!</p>
                    {if:else}
                        <div class="view-options">{poll_view_options}</div>
                    {/if}
                    <div class="total-votes">{poll_total_votes} Total Votes</div>
                </div>
            {/if}

            <input type="hidden" name="poll_id" value="{poll_id}" />
        {/poll_form}

    {/if}
</div>
{/exp:polls:poll}

Support

Having problems setting up and/or using Polls? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.