1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Using images as poll options

Discussion in 'XenForo Questions and Support' started by Joshua, May 12, 2011.

  1. Joshua

    Joshua Active Member

    I run a photo contest on my site as I'm sure many other Xenforo users do. I'd like to be able to add the submitted photos into the actual poll so users can see the images next to the radio button when voting. I tried using html img tags and mycode img tags. Neither worked.

    As a bonus, how can I allow users to vote for up to but no more than 3 images?

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    There is no support for inline images in the poll options. You will need an addon for this. If you post an Add-on Request then some one may be able to write this for you.

    There is no such option. It's one or all.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    FWIW, I dug a little deeper after my initial reply. There is actually a template helper you can use to render bbcode, but I have been unable to find an available parser object to pass to the helper.

    This is as far as I got:

    Admin CP -> Appearance -> Templates -> poll_block_vote

    In this code:

    	<ol class="pollOptions">
    		<xen:foreach loop="$poll.responses" key="$pollResponseId" value="$response">
    			<li class="pollOption"><label><xen:if is="{$poll.multiple}">
    				<input type="checkbox" name="response_multiple[]" value="{$pollResponseId}" /><xen:else />
    				<input type="radio" name="response" value="{$pollResponseId}" /></xen:if>
    Replace this:

    with this:

    {xen:helper bbcode, $parser, $response.response}
    The problem is that $parser doesn't exist. If some one can find a parser that is available to this template then this method should work. Or if there is a way to instantiate an object via template syntax that would be cool. o_O
  4. Joshua

    Joshua Active Member

    how about a javascript test for the radio buttons and selecting only 3 or less?
  5. optrex

    optrex Active Member


    sorry to dig up an old thread, but did you get a final solution with this or does 1.1. make the process easier?
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  7. Mutt

    Mutt Well-Known Member

    i was working w/ this tonight w/ no luck. anyone get anywhere w/ this? bbcode would be nice but I'd settle for just the ATTACH tag

Share This Page