alexone Posted September 23, 2005 Posted September 23, 2005 Hi everybody, I don't fully understand how the infoBox class works, that's why I'm asking you about this. I'm using "News Desk" contribution and I have something like that: $latest_news_string = ''; $row = 0; while ($latest_news = tep_db_fetch_array($latest_news_var_query)) { $latest_news['newsdesk'] = array( 'name' => $latest_news['newsdesk_article_name'], 'id' => $latest_news['newsdesk_id'], 'date' => $latest_news['newsdesk_date_added'], ); $latest_news_string .= '<a href="'; $latest_news_string .= tep_href_link(FILENAME_NEWSDESK_INFO, 'newsdesk_id=' . $latest_news['newsdesk_id']); $latest_news_string .= '">'; $latest_news_string .= $latest_news['newsdesk_article_name']; $latest_news_string .= '</a>'; $latest_news_string .= "\n"; $info_box_contents = array(); $info_box_contents[] = array('params' => 'class="someClass"', 'text' => $latest_news_string); $row++; } news are displayed in one cell, but I want them to be displayed in separate rows. How can I do it? Thanks for help. Alex //Sorry for stupid question.
Guest Posted September 23, 2005 Posted September 23, 2005 this code will generate separate rows/cells for each entry, because the whole thing is inside the while statement. The tablebox class generates a table and for each entry in the array builds a row (with 1 or more td cells depending if the array is md)
alexone Posted September 23, 2005 Author Posted September 23, 2005 this code will generate separate rows/cells for each entry, because the whole thing is inside the while statement. The tablebox class generates a table and for each entry in the array builds a row (with 1 or more td cells depending if the array is md) <{POST_SNAPBACK}> if you say so... bu it doesn't and I don't know why.. all content is placed in one cell.. thats why I'm so confused. Any suggestions??? Thx Alex
Guest Posted September 23, 2005 Posted September 23, 2005 oops you right it wont. I missed that earlier. The array is re-initialized every time :lol: nice bug. Move this line $info_box_contents = array(); after the $row = 0; Should work
alexone Posted September 23, 2005 Author Posted September 23, 2005 oops you right it wont. I missed that earlier. The array is re-initialized every time :lol: nice bug. Move this line $info_box_contents = array(); after the $row = 0; Should work <{POST_SNAPBACK}> It works! Thanks a lot! Could you please explain what was the problem? Thanks again. Best regards. Alex
Guest Posted September 23, 2005 Posted September 23, 2005 basically it was loading the elements to the same entry, over and over again so you ended up with the last entry of the news desk. The code should accumulate them.
alexone Posted September 23, 2005 Author Posted September 23, 2005 basically it was loading the elements to the same entry, over and over again so you ended up with the last entry of the news desk. The code should accumulate them. <{POST_SNAPBACK}> Thanks. Last question. Could you tell me how to create for example two cells per row of content using infoBox? Alex.
Guest Posted September 23, 2005 Posted September 23, 2005 you could do that by using a multi-dimensional array of the box contents $your_box_contents[0][] = You can see the includes\modules\product_listing.php file how it sets up the various columns.
alexone Posted September 24, 2005 Author Posted September 24, 2005 you could do that by using a multi-dimensional array of the box contents $your_box_contents[0][] = You can see the includes\modules\product_listing.php file how it sets up the various columns. <{POST_SNAPBACK}> Now I understand. Thanks again. Regards Alex.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.