I posted ealier, about 30 minutes ago. While I’m waiting to see what that brings I decided to try a different approach.
<?php $cnt = 1; ?>
{exp:channel:categories channel='events' category_group='3' style='linear'}
<li> -----------------------</li>
<li> $cnt = <?php echo $cnt; ?></li>
<li> parent_id = {parent_id}</li>
<li> embed:parent = {embed:parent}</li>
{if parent_id == embed:parent}
<?php if ($cnt == 1) { ?>
<li class="tour-event"><a href="http://{path=/{segment_1}/{category_url_title}}"><?php echo '= '.$cnt; ?> - {category_name}</a></li>
<?php $cnt = $cnt + 2;} else { ?>
<li class="tour-event"> :: <a href="http://{path=/{segment_1}/{category_url_title}}"><?php echo '= '.$cnt; ?> - {category_name}</a></li>
<?php } ?>
{/if}
{/exp:channel:categories}Since I can’t get the backspace to work (as desired / expected), I figured I could accomplish similar with a flag/toggle. Basically, if it’s the first child don’t prefix that ’ :: ’ separator. For all other children prefix ’ :: ‘.
But it’s not working as expected (or maybe it’s a parse order issue). Here’s a snippet of my output:
———————————
$cnt = 1
parent_id = 0
embed:parent = 17
———————————-
$cnt = 3
parent_id = 17
embed:parent = 17
:: = 3 - Child 1 (July 2013)
———————————-
$cnt = 3
parent_id = 17
embed:parent = 17
:: = 3 - Child 2 (May 2013)
———————————-
The first “row” is the parent. It passes over that because parent_id != embed:parent. Then somehow my flag $cnt changes value, as if the first child was already displayed. But the flag isn’t supposed to change until after that.
I’m super confused.
Thanks in advance
Mark