By: delta
Date: 2008-06-08
Time: 15:20
|
navsize
Hi!
Is it possible to make a dynamic navsize value?
Here is the template code:
<ul id="pager">
<li><a href="{var.current_url}/page/{var.cat;}{var.cat;if {val}='';then '';else '/'}{nv.first;endpoint;magnet=a;mtype=m+m}/" class="begin">|<</a></li>
<li><a href="{var.current_url}/page/{var.cat;}{var.cat;if {val}='';then '';else '/'}{nv.prev;endpoint;magnet=a;mtype=m+m}/" class="back"><</a></li>
<li><a href="{var.current_url}/page/{var.cat;}{var.cat;if {val}='';then '';else '/'}{nv.page;block=li;navsize={var.navsize};navpos=centred}/">{nv.page}</a></li>
<li class="on">{nv.page;block=li;currpage}</li>
<li><a href="{var.current_url}/page/{var.cat;}{var.cat;if {val}='';then '';else '/'}{nv.next;endpoint;magnet=a;mtype=m+m}/" class="next">></a></li>
<li><a href="{var.current_url}/page/{var.cat;}{var.cat;if {val}='';then '';else '/'}{nv.last;endpoint;magnet=a;mtype=m+m}/" class="end">>|</a></li>
</ul>
|
The Navbar ignores my var.navsize!
PHP:
$navsize = 30; // This is just a test-variable. Actually a db-value...
$pagesize = 9; // No problem....
$TBS->PlugIn(TBS_BYPAGE,$pagesize,$PageNum,$RecCnt); // Next block will be merged suing By-Page mode.
$RecCnt = $TBS->MergeBlock('item_pagination',$connect,"SELECT * FROM ".$module_type." WHERE type!='art' ORDER BY ".$order_article." ".$sort_article."",$pagesize,$PageNum,$RecCnt);
// Merge the Navigation Bar
$TBS->PlugIn(TBS_NAVBAR,'nv','',$PageNum,$RecCnt,$pagesize);
|
Thank you for help!
|
By: Skrol29
Date: 2008-06-09
Time: 09:55
|
Re: navsize
Hi Delta,
your {var.navsize} is ignored because it is not yet merged when the NavBar is merged. Var fields are merged on Show.
You should replace it with {onload.navsize}.
But $navsize must be defined before the LoadTemplate().
Another way is to give $navsize as an option for the plugin:
http://www.tinybutstrong.com/plugins.php?help#plugin_navbar
$TBS->PlugIn(TBS_NAVBAR,'nv',$navsize,$PageNum,$RecCnt,$pagesize);
|
|