![]() |
|
|
Thread Tools |
|
#1
|
||||||||
|
||||||||
|
Nested Loop with templates
Wonder if anyone can help. What I'm trying to do is show a gig listings but add multiple ticket buying options.
I'm stuck though at the nested part and getting it to display in the template. I'm pretty sure the bit that's wrong is the 1st and 3rd line as if I do it with just the second line I get one link displayed but with this code I get none. I know it's something simple but I'm new to the way vB4 does stuff. So any ideas?
Here's the full loop with nesting
No members have liked this post.
|
||||||||
|
#2
|
||||
|
||||
|
You just need to register the array:
And now in the template you may use {vb.raw linkrow.ticketlink}
__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
||||
|
#3
|
||||
|
||||
|
Where do I need to put that register line?
Also do I need a separate bit template for the {vb.raw linkrow.ticketlink} or can I jsut include it in the main template? No members have liked this post.
|
|
#4
|
||||
|
||||
|
In place of this one:
Then just use the variable {vb.raw linkrow.ticketlink} in the template.
__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
||||
|
#5
|
||||
|
||||
|
I must be doing something wrong that's giving blank results.
.No members have liked this post.
|
|
#6
|
||||||||||||||||
|
||||||||||||||||
|
Heres the full page code with the suggested change made.
main template (only the main display of table)
templatebit that does the rows
third template for the ticket link
What seems to be happening is the ticket link is being skipped somehow then then just dropped in at the top of the gig list page. It doesn't seem to be getting included in the template. No members have liked this post.
|
||||||||||||||||
|
#7
|
||||
|
||||
|
I *think* (I'm not positive) that you need to use a different variable for your template rendering in the second while loop because you are using the same variable as the template above but it isn't 'complete' yet (you hadn't rendered it and thus completed the action). Maybe try this:
__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
||||
|
#8
|
||||
|
||||
|
That sorted them appearing at the top but still leaving me blank results at the ticket column :S.
No members have liked this post.
|
|
#9
|
||||
|
||||
|
I guess you're gonna have to do some debugging and see if your query is getting you what you want. So, play with that loop and see what is really being output.
__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
|
#10
|
||||
|
||||
|
Yup looks like it thanks for the help though, sure you've got me on the right track
![]() --------------- Added 21 Dec 2009 at 18:37 --------------- Getting there...
needed added after the second loop closed to bring the variable into the first loop. Now all I need to do is clear the variable after each loop I think so it's not constantly storing the same links. from the previous time. All sorted with addition of $event_giglistrowticket=''; after $event_giglistrow .= $templater->render(); Hopefully this helps someone else in future. No members have liked this post.
Last edited by Ghostsuit : 21 Dec 2009 at 17:53. Reason: Auto-Merged DoublePost |
||||
|
#11
|
||||
|
||||
|
Great!
__________________
Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools - Online vBulletin Manual If I post some CSS and don't say where it goes, put it in the additional.css template. I will NOT help via PM (you will be directed to post in the forums for help.) No members have liked this post.
|
![]() |
«
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 09:47.


.
