XF 1.2 ad_thread_list_below_stickies background colour

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?
 
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}...
 
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?
 
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.
 
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.
 
Top Bottom