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

XF 1.2 ad_thread_list_below_stickies background colour

Discussion in 'Styling and Customization Questions' started by Gladius, Mar 8, 2014.

  1. Gladius

    Gladius Well-Known Member

    I've put some ad code in that template, but now I'd like to do a couple of things:

    1) Style the area where the ad appears so that it has the same background colour as the rows in the thread list.

    2) Make it so that when there are no stickies in a forum, the ad code appears after say the first 5 posts on the list.

    What would be the easiest ways to achieve that?
     
  2. Gladius

    Gladius Well-Known Member

    Anyone? At least help me with #1...
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Surround your ad code in a div and use inline styling, for example:
    Code:
    <div style="background-color: contentBackground">
    Ad code here
    </div>
    For the other, you can use conditional statements utilising <xen:if is="{$stickyThreads}...
     
  4. Gladius

    Gladius Well-Known Member

    Hmm, I tried that already but it's not showing, is it possible something's overriding it?

    Aha, I was hoping there's a conditional for that, could you give me the whole line?
     
  5. Gladius

    Gladius Well-Known Member

    To clarify, I'd like the ad code to show after the 5th thread in the thread list in cases when there are no stickies in a given forum OR when users are on say page 2, 3, etc. of the list and the stickies don't show there any more. If it was easier to do the ad code could just show after every 5th thread on the list on every page of the thread list, regardless of whether there were any stickies or not.

    This below stickies template is rather ill-conceived, if there was one that'd just show the code after say every 5th post in the thread list per page I think it'd be much more useful.
     
  6. Brogan

    Brogan XenForo Moderator Staff Member

    You can use a conditional statement to show it after x posts per page: <xen:if is="{$post.position} == 4 AND !{$message.conversation_id}">

    You can combine that with the if sticky check to achieve what you want.
     
  7. Gladius

    Gladius Well-Known Member

    OK, thanks.
     

Share This Page