2

How do I add a value to the {count} variable?

I'm trying to do this:

{exp:channel:entries channel='links' orderby='link_order' sort='asc' dynamic='no'  category='12'}
<div class="item" id="pane-{count+15}" style="display: none;">
    <!-- stuff here -->
</div>
{/exp:channel:entries}

I want the HTML to come out like this:

<div class="item" id="pane-16" style="display: none;">
    <!-- stuff here -->
</div>
<div class="item" id="pane-17" style="display: none;">
    <!-- stuff here -->
</div>
<div class="item" id="pane-18" style="display: none;">
    <!-- stuff here -->
</div>

1 Answer 1

4

By default, EE is support calculations in conditions only. For other cases you can use MX Calc

{exp:channel:entries channel='links' orderby='link_order' sort='asc' dynamic='no'  category='12' parse="inward"}
<div class="item" id="pane-{exp:mx_calc expression='{count}+15'}" style="display: none;">
    <!-- stuff here -->
</div>
{/exp:channel:entries}
1
  • 1
    There are few math / calculation add-ons for EE (search results), but MX Calc is most of the times choice #1
    – Yuri Salimovskiy
    Feb 3, 2015 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.