Developer
Supported
In
ExpressionEngine 2
Back to this add-on's main page
View Other Add-ons From Causing Effect
Issues with Modulus Condition inside In:clude
Support Request
brianrivet
|
Posted: 30 October 2015 09:51 PM |
|
|
|
Hi Aaron,
I am running In v. 1.2 on EE v. 2.10.1
I am having a problem with a modulus conditional inside of my in:clude . Here’s the template code I am including with the exp:in:clude tag:
{exp:channel:entries channel="blog_entries" dynamic="no" orderby="date" sort="desc"} {if {count} % 3 == 1} <div class="row"> {/if} <div class="col-sm-4 blog-item-wrapper {count}"> <a href="{page_url}" class="blog-item"> <p>{title}</p> {content_images limit="1" category="thumbnail"} <img src="{image:url:thumbnail}"x="{image:url:thumbnail@2x}" /> {/content_images} </a> </div> {if {count} % 3 == 0} </div> {/if} {/exp:channel:entries}
The template is rendering, however the line that should be getting output to start each row (count % 3 == 1) is never getting output and the line that should end each row (count % 3 == 0) is getting output on every loop. I took the channel entry tag out and put it in its own template and it works just fine, so I am thinking there is some sort of issue with putting it inside the in:clude but I don’t know what it is. Can you help me to troubleshoot?
Thanks,
Brian
|
|
|
brianrivet
|
Posted: 02 November 2015 06:59 PM |
# 1
|
|
|
Aaron, I have another include template that is not parsing conditionals. Here’s the code in the included template:
{exp:comment:entries orderby="date" sort="desc" dynamic="no" entry_id="{embed:whichEntry}"}
{if count == 1} <div class="page-row tan-bg blog-comment-form-wrapper"> <div class="container"> <div class="row row-main">
<div class="col-sm-12"> <h3><div class="redline"></div><span>Comments</span></h3> {/if} <p> {comment_stripped}<br> <em>By <a href="mailto:{email}">{name}</a> on {comment_date format="%F %d, %Y at %g:%i %a"}</em></p>
{if count == total_results}
</div>
</div><!--row--> </div><!--container--> </div>
{/if}
{/exp:comment:entries}
None of the code in the count conditionals is being written out.
|
|
|
brianrivet
|
Posted: 03 November 2015 07:33 PM |
# 2
|
|
|
Hi Aaron,
I just wanted to check in and see if you had a chance to look into this yet. I’ve tried the count in the first example with the brackets around the variable, without the brackets and with and without quotes and brackets and none of them worked.
Thanks,
Brian
|
|
|