Categories > TinyButStrong general >

Condition: "display this except last time"

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: c wells
Date: 2006-07-03
Time: 20:32

Condition: "display this except last time"

I am creating a subnavigation system that will look like:

page1 * page2 * page3 * page4

I want to not display the bullet on the last one.  I currently have:
[Sub;block=begin]<a href="?page=[var.level1Nav]&sub=[Sub.$]" class="side-sub">[Sub.$]</a> &nbsp;&bull;&nbsp; [Sub;block=end]

...which will obviously put the bullet in there that final time.  How do I get rid of that final bullet?  I'm using PHP arrays as my data set.

Thanks!
By: TomH
Date: 2006-07-03
Time: 22:08

Re: Condition: "display this except last time"

Just  a thought... switch based on the record number...
If there is always one or more items...
do the first one separately (untested) like this

[Sub;block=begin]<a href="?page=[var.level1Nav]&sub=[Sub.$;when Sub.# = 1]" class="side-sub">[Sub.$]</a>[Sub;block=end]

then do the remaining items something like (untested) this...

[Sub;block=begin] &nbsp;&bull;&nbsp;<a href="?page=[var.level1Nav]&sub=[Sub.$;when Sub.# +- 1]" class="side-sub">[Sub.$]</a>  [Sub;block=end]
By: c wells
Date: 2006-07-03
Time: 22:39

Re: Condition: "display this except last time"

I don't think you can use Sub.# in a conditional.  I've tried conditional var's, like:
[var.numSubNav;if [Sub.#] < var.numSubNav;then ' &nbsp;&bull;&nbsp; ']

..but that doesn't work, because I don't think it will evaluate .# programmatically.