Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Problem using Template Conditionals
hansolo Offline
Junior Member
**
Posts: 22
Joined: Sep 2015
Post: #1
Problem using Template Conditionals
Hi All,

I've just installed the 'template conditionals' plugin. I want to use it to display certain buttons only on the first post of a thread, in a new bar just above the Post Controls bar.

My code, which I've added to the sub-forum postbit template, looks like:

Code:
<if($mybb->post['replyto'] == "0") then>
	<div class="special_controls">
		<span>SPECIAL CONTROLS WILL GO HERE</span>
	</div>
</if>


My browser says "Content Encoding Error" when I try to open this page. Why is this?

Also is this the right way to implement this functionality, or is there a better way that keeps functional code out of the templates?

Cheers!


Turns out it's whitespace sensitive. Needs to be:

Code:
<if ($post[...


I do have one more question:
Where is the 'post_controls' class assigned its layout? Is it in a .css file or in the template somewhere? I tried a full directory search and couldn't find it.

Cheers!
(This post was last modified: 09-19-2015 01:24 AM by hansolo.)
09-19-2015 01:03 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Problem using Template Conditionals - hansolo - 09-19-2015 01:03 AM

 Standard Tools
Forum Jump: