![]() |
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? Code:
$templater = vB_Template::create('event_giglistrowticket'); Code:
$results = $vbulletin->db->query_read("SELECT date_format(gig.date, '%a %D %b %y') AS gig_date, gig.gigid, venue.venuename AS gig_venuename, gig.title, gig.status, gig.age |
You just need to register the array:
PHP Code:
|
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? |
In place of this one:
PHP Code:
|
I must be doing something wrong that's giving blank results. :(.
|
1 Attachment(s)
Heres the full page code with the suggested change made.
Code:
<?php Code:
<table align="center" border="1" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%"> Code:
<tr class="alt2"> Code:
{vb:raw linkrow.ticketlink} It doesn't seem to be getting included in the template. |
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:
PHP Code:
|
That sorted them appearing at the top but still leaving me blank results at the ticket column :S.
|
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.
|
Yup looks like it thanks for the help though, sure you've got me on the right track :D
--------------- Added 21 Dec 2009 at 18:37 --------------- Getting there... Code:
$templater->register('event_giglistrowticket', $event_giglistrowticket); All sorted with addition of $event_giglistrowticket=''; after $event_giglistrow .= $templater->render(); Hopefully this helps someone else in future. |
All times are GMT. The time now is 06:02 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|