Hi,
I hope you appreciate this - its taken me bloody ages to do ;)
First - you need 2 new globals:
load_sub_cats_menu
my $tbl = $DB->table('Category');
my $sth = $tbl->select( { FatherID => $_[0] } );
my @loop;
my $i = 0;
while (my $hit = $sth->fetchrow_hashref) {
$hit->{URL} = $CFG->{build_root_url} . "/" . $tbl->as_url( $hit->{Full_Name} ) . "/" . $CFG->{build_index};
push @loop, $hit;
}
return { load_sub_cats_menu_loop => \@loop }
}
make_top_nav_loop
my $tbl = $DB->table('Category');
my $sth = $tbl->select( { CatDepth => 0 } );
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
$hit->{subcatcount} = $tbl->count( { FatherID => $hit->{ID} } ) || 0 ;
$hit->{URL} = $CFG->{build_root_url} . "/" . $tbl->as_url( $hit->{Full_Name} ) . "/" . $CFG->{build_index};
push @loop, $hit;
}
return { top_nav_menu => \@loop }
}
Then, upload the attached file (obviously decompress it =)) to the /static folder.
Then, in include_common_head.html, you need to add this at the end of it:
<script type="text/javascript" src="<%config.build_static_url%>/chromejs/chrome.js" ></script>
Then, finally in include_header.html, add the following (again, at the very bottom of the template):
<div class="chromestyle" id="chromemenu">
<ul>
<%loop top_nav_menu%>
<li><a href="<%URL%>" <%if subcatcount > 0%>rel="dropmenu<%row_num%>"<%endif%>><%Name%></a></li>
<%endloop%>
</ul>
</div>
<%loop top_nav_menu%>
<%load_sub_cats_menu($ID)%>
<%if load_sub_cats_menu_loop.length%>
<div id="dropmenu<%row_num%>" class="dropmenudiv">
<%loop load_sub_cats_menu_loop%>
<a href="<%URL%>"><%Name%></a>
<%endloop%>
</div>
<%endif%>
<%endloop%>
<script type="text/javascript">
cssdropdown.startchrome("chromemenu")
</script>
I've tested that now, and it all seems to be working fine =)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
I hope you appreciate this - its taken me bloody ages to do ;)
First - you need 2 new globals:
load_sub_cats_menu
Code:
sub { my $tbl = $DB->table('Category');
my $sth = $tbl->select( { FatherID => $_[0] } );
my @loop;
my $i = 0;
while (my $hit = $sth->fetchrow_hashref) {
$hit->{URL} = $CFG->{build_root_url} . "/" . $tbl->as_url( $hit->{Full_Name} ) . "/" . $CFG->{build_index};
push @loop, $hit;
}
return { load_sub_cats_menu_loop => \@loop }
}
make_top_nav_loop
Code:
sub { my $tbl = $DB->table('Category');
my $sth = $tbl->select( { CatDepth => 0 } );
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
$hit->{subcatcount} = $tbl->count( { FatherID => $hit->{ID} } ) || 0 ;
$hit->{URL} = $CFG->{build_root_url} . "/" . $tbl->as_url( $hit->{Full_Name} ) . "/" . $CFG->{build_index};
push @loop, $hit;
}
return { top_nav_menu => \@loop }
}
Then, upload the attached file (obviously decompress it =)) to the /static folder.
Then, in include_common_head.html, you need to add this at the end of it:
Code:
<link rel="stylesheet" type="text/css" href="<%config.build_static_url%>/chrometheme/chromestyle2.css" /> <script type="text/javascript" src="<%config.build_static_url%>/chromejs/chrome.js" ></script>
Then, finally in include_header.html, add the following (again, at the very bottom of the template):
Code:
<%make_top_nav_loop%> <div class="chromestyle" id="chromemenu">
<ul>
<%loop top_nav_menu%>
<li><a href="<%URL%>" <%if subcatcount > 0%>rel="dropmenu<%row_num%>"<%endif%>><%Name%></a></li>
<%endloop%>
</ul>
</div>
<%loop top_nav_menu%>
<%load_sub_cats_menu($ID)%>
<%if load_sub_cats_menu_loop.length%>
<div id="dropmenu<%row_num%>" class="dropmenudiv">
<%loop load_sub_cats_menu_loop%>
<a href="<%URL%>"><%Name%></a>
<%endloop%>
</div>
<%endif%>
<%endloop%>
<script type="text/javascript">
cssdropdown.startchrome("chromemenu")
</script>
I've tested that now, and it all seems to be working fine =)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!