Description
Renders a poll from the Polls module on the page. The first argument pid is the id of the Polls MODULE the poll belongs to, not a single poll id. With only pid, AA shows the one newest active poll of that module (status published, inside the publish/expiry window) in its before-vote design: the question, each answer as a clickable vote link with a bar showing its current share, and the running totals. The second argument params is an optional URL-encoded query string (name=value pairs joined by ampersands) that overrides the defaults - the same names a poll vote link carries. poll_id renders one specific poll directly, skipping the date filter; design_id forces a named design; listlen and from page through several of the module polls; conds and sort filter and order them the AA way (a conds entry carrying an expiry_date key also turns off expiry filtering); convertfrom and convertto recode the output charset. A visitor votes by following an answer link, which calls polls again with poll_id and vote_id set - that records one vote, subject to the poll IP-lock and cookie settings, and then re-renders the poll in its after-vote design. WRITE WARNING: poll_id together with vote_id WRITES a vote on every render, so never hard-code that pair in a page-load template; the answer link is built by the design for the visitor to click (add novote to take the after-vote path without recording). polls is never cached and its output is live, install-specific markup, so on an install with no published polls it renders nothing.
Parameters
pid requiredThe id of the Polls module the poll belongs to - the module, not a single poll. AA lists that module active polls (status published, inside the publish/expiry window) and, with no params, renders the newest one. Read it from the Polls module admin, or via {modulefield:moduleid:name}-style lookups. If pid names no Polls module, the output is empty.
params optional default (empty)An optional URL-encoded query string (name=value joined by ampersands) that overrides the defaults, the same names a poll vote link carries. Recognized keys: poll_id - render this exact poll instead of the module newest; vote_id - the answer being voted (only ever sent together with poll_id, from a visitor click - it WRITES a vote, so never put both in a page-load template); novote - present alongside poll_id+vote_id to re-render without recording the vote; design_id - force a named poll design; listlen - how many polls to show (default 1); from - 1-based offset into the module polls; conds and sort - filter and order the module polls the AA way; convertfrom and convertto - recode the output charset. Leave empty to show the module newest poll in its before-vote design.