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

How to hide poll result from guest?

Discussion in 'XenForo Questions and Support' started by Andy To, Apr 8, 2011.

  1. Andy To

    Andy To Member

    Is there any template modification/add on that will hide poll from guest? Instead of the result, I will like it show the voting options.

    I tried to take a look at the templates for some clue, but didn't get far. I am not sure how <xen:raw $options>. Anyone has look at the template and care to explain that to me?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Edit the thread_view template to add a conditional like so:
    <xen:if is="{$visitor.user_id}">
    <xen:if is="{$poll}">
        <xen:include template="poll_block">
            <xen:set var="$options">
                <xen:if is="{$poll.canVote}">
                    <xen:include template="poll_block_vote" />
                <xen:else />
                    <xen:include template="poll_block_result" />
    Oh wait, I've just realised that you want to hide the results and allow voting.

    Guests can't vote on polls.
  3. Andy To

    Andy To Member

    Thanks, I actually do not want guest to vote, but are shown the options for voting. Anyhow, thanks for pointing me at the correct direction I managed to find what I am looking for. I will show the vote block to guest but disable the input and that works out great, with some minor changes.

Share This Page