Make polls stand out in XenForo

Today we are going to discuss how to make your poll topics stand out! Now this does take a bit of patience but it’s pretty easy once you learn your way around. We are going to modify two things in the template section. Once you are finished your poll topics will look like so:


So let’s get started. First log into your admin panel. On the top menu click Appearances like so:


Click templates on the left like so:


It will take you to this page:


So we are going to modify the page called thread_list_item You can search for it if you wish but you will find it and it will look like so:


Click and you will see this:


So we are going to go as slow as possible so you don’t mess up. We are looking for the following code line:

<xen:if is="{$showSubscribeOptions}"><input type="checkbox" name="thread_ids[]" value="{$thread.thread_id}" /></xen:if>
<xen:if is="{$thread.prefix_id}">

It should be about half way down the page like so:


So before the line <xen:if if=”{$thread.prefix_id}”>  and after the line directly above it you will put:

<xen:if is="{$thread.discussion_type} == 'poll'">

I would recommend aligning the text as it makes it easier to read or indent it. In the next screenshot I have done this. So once you finish it will look like the following image:


You can put what ever you wish to here too. It doesn’t have to be Poll. It can be a image or different text it’s up to you. Now that you have done that click save. You can check to make sure that you have done it right. Create a poll and look at it in the node list and it should have Poll in front like so:



Ok so the final part here is to highlight the poll like the above image. Stay in thread_list_item and find the following line:

<li id="thread-{$thread.thread_id}" class="discussionListItem {$thread.discussion_state}{xen:if '!{$thread.discussion_open}', ' locked'}{xen:if {$thread.sticky}, ' sticky'}{xen:if {$thread.isNew}, ' unread'}{xen:if {$thread.prefix_id}, ' prefix{$thread.prefix_id}'}{xen:if {$thread.isIgnored}, ' ignored'} {xen:if $thread.thread_is_watched, threadWatched} {xen:if $thread.forum_is_watched, forumWatched}" data-author="{$thread.username}">


It should be the third line from the top of the page like so:


So we have to insert a snippet of code that is the following:

{xen:if "{$thread.discussion_type} == 'poll'", ' discussionListItemPoll'}

Now where do we put this you ask? Well in the line of code above we are looking for the following part:

{$thread.discussion.state} {xen:if=”!{thread.discussion_open}

We are putting the code in between the two statements like so:

{$thread.discussion.state}{xen:if “{$thread.discussion_type} == ‘poll'”, ‘ discussionListItemPoll’} {xen:if=”!{thread.discussion_open}

Once you do this it should look like the following:


Ok so now that is all done we click save. Now go to back to templates and look for Extra.css  and go to that page like so:


We are going to insert the following code in order to edit the box around the poll threads. So insert the following code:

    border: 1px solid red !important;

It will look like so:


So you can change how big it is or what color it is here.

So the finished product will look like the first image did before:


There ya have it! If you have anymore questions or need clarification please feel free to ask away!

Looking for quality XenForo hosting? Check out Arvixe Web Solutions

Tags: , , , , , , , , | Posted under XenForo | RSS 2.0

Author Spotlight

Keith Pottratz

Hello My Name is Keith Pottratz. I have been working with computers for over a decade. It's my personal hobby something that I love and enjoy doing. I went to school for Computer Science, and have spent many years self teaching my self various things. I have ton's of experience in HTML,CSS, PHPBB,CPanel,CMS software, blogging software and various other systems and enviroments. My favorite thing to do though is backend developing. I find it to be a growing and ever evolving beast and I love learning about it. I look forward to giving as much knowledge as I can and help.

Leave a Reply

Your email address will not be published. Required fields are marked *