plainblack.com
Username Password
search
Bookmark and Share

    

Navigation pages count?

User petr999
Date 12/22/2005 4:32 am
Views 4926
Rating 40    Rate [
|
]
Previous · Next
User Message
petr999

Hello,

I need navigation pages count (the how many times page_loop of the Navigation Template repeats). How could I get it?

The need is to provide the navigation layout in the form:

1-2-3-4

5-6-7-8

Just gonna change the number of navigation elements (say, 8 to 10 ), so the position of line break should change according to pages.count/2 in my <tmpl_if expr=...

I looked up the HTML/Template.pm code without luck:( Just tried to use <tmpl_var page_loop> since page_loop is array reference in did and scalar( @$page_loop ) should do the rick but seem HTML::Template internals are not adopted for such trick...

Thanks.
.

--- (Edited on 12/22/2005 14:32:27 [GMT+0400] by petr999) ---



Back to Top
Rate [
|
]
 
 
crythias

I have an idea using javascript.

According to this, JS variables are/can be global.

So, I'd consider putting an initial variable before the loop...
<script language="JavaScript" type="txt/javascript'>
<!--

var pages_count =1;

-->
</script>

<tmpl_loop position_loopX>

stuff..

<script language="JavaScript" type="txt/javascript'>
<!--

pages_count++;

//loop condition info 

-->
</script>

morestuff

</tmpl_loop>
--
Maintainer of an unofficial WebGUI FAQ Please contribute questions or answers!
When asking questions on this forum, please indicate (at least) which version of WebGUI you are using. Optional, but sometimes helpful, are your Operating System name and version, PERL version, and Apache version. The little icons next to my picture indicate my IM status. Yes, you are welcome to IM me. I am not an employee of Plain Black. My offers of assistance are subject to the general disclaimer of this discussion board that my answer may be completely wrong. Have a great day!
www.gwy.org U2U

 
--- (Edited on 12/22/2005 8:41 am [GMT-0600] by crythias) ---



Back to Top
Rate [
|
]
 
 
crythias

 

2 things about my method... I suppose you'd have to loop increment twice (two variables)..once to count and once to index.

and not position_loop. (sorry :)

Alternative (though you may not like it) is to *ahem* simply create two grouping folders/page layouts that won't appear in Navigation. Let them hold SHORTCUTS to the assets to place in navigation and simply choose siblings. AssetProxy those Navigations where you want.

ETA: Oh, and yeah, proper closing of " would be nice as well.
--
Maintainer of an unofficial WebGUI FAQ Please contribute questions or answers!
When asking questions on this forum, please indicate (at least) which version of WebGUI you are using. Optional, but sometimes helpful, are your Operating System name and version, PERL version, and Apache version. The little icons next to my picture indicate my IM status. Yes, you are welcome to IM me. I am not an employee of Plain Black. My offers of assistance are subject to the general disclaimer of this discussion board that my answer may be completely wrong. Have a great day!
www.gwy.org U2U

 
--- (Edited on 12/22/2005 1:14 pm [GMT-0600] by crythias) ---

 

--- (Edited on 12/22/2005 1:16 pm [GMT-0600] by crythias) ---



Back to Top
Rate [
|
]
 
 
    



© 2019 Plain Black Corporation | All Rights Reserved