![]() |
|
Thread Tools |
#1
|
||||||||||||
|
||||||||||||
nested dependent vb:each - building headers for sorting
Hello,
I have tried numerous ways, but am beginning to think this not possible (or i'm just stuck looking at it from a single angle), so figured i'd try to get some outside opinions/help. In my php file, i create an array that looks like the following:
In my template, i can successfully display the entire list using
However, what i would like to do is separate the items based on the location, something similar to the image that i attached. A rough code might be something like this, but i know that vb:raw cannot be used in a conditional, and i cannot figure out how to work around this.
No members have liked this post.
|
#2
|
||||||||
|
||||||||
I think that appraoch will work but you might need to create your own array of locaitons and register it too. Maybe try something like this:
and then in your template:
I'm not sure of there's any way to use the value from the outer vb:each to specify the inner vb:each array. That would make things a little more efficient. The following members like this post: wpeloquin
Last edited by kh99; 11 Apr 2012 at 04:47. |
#3
|
|||
|
|||
That didn't work (for me, anyways). I think it still sees the objects in the IF statement as <vb:raw> statements...
No members have liked this post.
|
#4
|
|||
|
|||
I did have one error in the code above, which I just fixed. It said location.location when it should just be location. Also I left out the htmlspecialchars when setting the locations array. But I did test it and it basically seemed to work. What happens when you try?
No members have liked this post.
|
#5
|
||||
|
||||
I had to play with the <table> tag and it is working now (see below). Much thanks kh99! I was on the right track it seems, just off on the syntax. You saved me many hours of tedious hair pulling
![]()
No members have liked this post.
Last edited by wpeloquin; 13 Apr 2012 at 22:21. |
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 03:25.