By: Unni
Date: 2012-11-15
Time: 13:21
|
single navigation for 2 blocks
I have 2 merge blocks
$RecCnt =$TBS->MergeBlock('listprosearch', $product_display_array); // This one for product listing
$RecCnt =$TBS->MergeBlock('listcontsearch', $content_display_array);//This one for page content listing
I need a single navigation bar for these 2 data listings within a page.
suppose product list has 10 items and content list has 50 items
If i set 30 as number of items in a page.... 10 items from product and 20 items from the contents on the first page and remaining 30 contents items on the second page...
Is this possible? please give me the guidance.. Thanks
|
By: Skrol29
Date: 2012-11-16
Time: 01:18
|
Re: single navigation for 2 blocks
Hi,
In your example, $PageNum has the same value for the navigation bar and the two data blocks for merging.
Neverthless, $PageSize and $RecCnt are different for those 3 merges.
You have :
$PageSize_Product = 10;
$PageSize_Contents = 20;
$PageSize_NavBar = $PageSize_Product + $PageSize_Contents;
$RecCnt_Product = count($product_display_array);
$RecCnt_Contents = count( $content_display_array);
$RecCnt_NavBar = $RecCnt_Product + $RecCnt_Contents;
Then you can perform the 3 merges quite like in the TBS online example.
|
By: Unni
Date: 2012-11-21
Time: 01:40
|
Re: single navigation for 2 blocks
Hi,
I need to accomplish a navigation bar for two data set... the whole data come from first data set initially and then from the next
These are our two data set
$content_display_array=array('UNNI','REMA','KANNAN','JON','LEIGH','ARCHANA','DEEPAK','JOE','ALEX','JIMMY','LAL','SHAJU','AJOY');
$Product_display_array=array('LION','TIGER','RAT','CAT','DOG','FOX','COW','MOUSE','CROW','HEN','DUCK','SNAKE');
In page 1 we need
'UNNI','REMA','KANNAN',
Page 2
'JON','LEIGH','ARCHANA'
Page 3
'DEEPAK','JOE','ALEX'
Page 4
'JIMMY','LAL','SHAJU'
Page 5
'SHAJU','AJOY','LION'
Page 6
'TIGER','RAT','CAT'
and so on
My coding is as follows
PHP
$PageSize1 = 2 ;
$PageSize1 = 1 ;
$PageSize = 3 ;
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('left.html') ;
$TBS->PlugIn(TBS_BYPAGE,$PageSize1,$PageNum, $RecCnt);
$RecCnt1 = $TBS->MergeBlock('listcontsearch', $content_display_array) ;
$TBS->PlugIn(TBS_BYPAGE,$PageSize2,$PageNum, $RecCnt);
$RecCnt2 = $TBS->MergeBlock('listprodsearch', $Product_display_array) ;
// Merge the Navigation Bar
$TBS->PlugIn(TBS_NAVBAR,'nv','',$PageNum,$RecCnt1+$RecCnt2,$PageSize) ;
$TBS->Show(TBS_OUTPUT) ; |
HTML
<table width=100% border=0>
<tr>
<td>
[listcontsearch.val][listcontsearch;block=tr]
[listprodsearch.val][listprodsearch;block=tr]</td></tr>
<tr>
<td><!-- same code than the exemple navigation bar -->
<div><table border="0" align="left" cellpadding="2" cellspacing="0">
<tr align="center">
<td><strong>Pages:</strong> </td>
<td width="16"><a href="[var.script]?PageNum=[nv.first;endpoint;magnet=a;mtype=m+m]">|<</a></td>
<td width="16"><a href="[var.script]?PageNum=[nv.prev;endpoint;magnet=a;mtype=m+m]"><</a></td>
<td width="16"><a href="[var.script]?PageNum=[nv.page;block=td;navsize=3;navpos=centred]">[nv.page]</a></td>
<td width="16" bgcolor="#2283BF"><strong>[nv.page;block=td;currpage]</strong></td>
<td width="16"><a href="[var.script]?PageNum=[nv.next;endpoint;magnet=a;mtype=m+m]">></a></td>
<td width="16"><a href="[var.script]?PageNum=[nv.last;endpoint;magnet=a;mtype=m+m]">>|</a></td>
</tr>
</table></div></td>
</tr>
</table> |
|