I am using Laura's Global as below:
my $args=shift;
my $db = $DB->table ('Category','CatLinks');
my ($cat_id,$full_name) = $db->select ( { 'CatLinks.LinkID' => $args->{ID} }, ['Category.ID', 'Category.Name'] )->fetchrow_array;
my $catlnk_db = $DB->table ('Links', 'CatLinks');
$catlnk_db->select_options ("ORDER BY $CFG->{build_sort_order_category}") if ($CFG->{build_sort_order_category});
my $sth = $catlnk_db->select ( { CategoryID => $cat_id, isValidated => 'Yes' }, [ 'Links.ID' ,'Links.Title'] );
my ($next,$prev,$next_title,$prev_title) ;
while (my ($id,$title) = $sth->fetchrow_array) {
if ($id == $args->{ID}) {
($next,$next_title) = $sth->fetchrow_array;
last;
} else {
$prev = $id;
$prev_title=$title;
}
}
my ($next_url, $prev_url);
if ($next) {
$next_url = qq~<a href="$CFG->{db_cgi_url}/page.cgi?g=Detailed/$next.html&d=1">$next_title</a>~;
}
if ($prev) {
$prev_url = qq~<a href="$CFG->{db_cgi_url}/page.cgi?g=Detailed/$prev.html&d=1">$prev_title</a>~;
}
return {next_url => $next_url, prev_url => $prev_url};
}
Global Source: https://www.gossamer-threads.com/forum/Products_C9/Gossamer_Links_C5/Development%2C_Plugins_and_Globals_F20/Re%3A_%5Bafinlr%5D_Next_Prev_-_Title_P270913/?search_string=prev%20title#p270913
& the code to output the info/value as below:
<%get_next%>
<%if next_url%> next_url = <%next_url%><br> <%endif%>
<%if prev_url%>prev_url = <%prev_url%><br> <%endif%>
It seems to work just fine, however the problem is with the URL for Prev & Next Link.
Is there any way to display Static URL for Prev & Next Links on Detailed page, instead of the dynamic URL that is being shown using the above global.
Thank you.
Vishal
-------------------------------------------------------
Code:
sub { my $args=shift;
my $db = $DB->table ('Category','CatLinks');
my ($cat_id,$full_name) = $db->select ( { 'CatLinks.LinkID' => $args->{ID} }, ['Category.ID', 'Category.Name'] )->fetchrow_array;
my $catlnk_db = $DB->table ('Links', 'CatLinks');
$catlnk_db->select_options ("ORDER BY $CFG->{build_sort_order_category}") if ($CFG->{build_sort_order_category});
my $sth = $catlnk_db->select ( { CategoryID => $cat_id, isValidated => 'Yes' }, [ 'Links.ID' ,'Links.Title'] );
my ($next,$prev,$next_title,$prev_title) ;
while (my ($id,$title) = $sth->fetchrow_array) {
if ($id == $args->{ID}) {
($next,$next_title) = $sth->fetchrow_array;
last;
} else {
$prev = $id;
$prev_title=$title;
}
}
my ($next_url, $prev_url);
if ($next) {
$next_url = qq~<a href="$CFG->{db_cgi_url}/page.cgi?g=Detailed/$next.html&d=1">$next_title</a>~;
}
if ($prev) {
$prev_url = qq~<a href="$CFG->{db_cgi_url}/page.cgi?g=Detailed/$prev.html&d=1">$prev_title</a>~;
}
return {next_url => $next_url, prev_url => $prev_url};
}
Global Source: https://www.gossamer-threads.com/forum/Products_C9/Gossamer_Links_C5/Development%2C_Plugins_and_Globals_F20/Re%3A_%5Bafinlr%5D_Next_Prev_-_Title_P270913/?search_string=prev%20title#p270913
& the code to output the info/value as below:
<%get_next%>
<%if next_url%> next_url = <%next_url%><br> <%endif%>
<%if prev_url%>prev_url = <%prev_url%><br> <%endif%>
It seems to work just fine, however the problem is with the URL for Prev & Next Link.
Is there any way to display Static URL for Prev & Next Links on Detailed page, instead of the dynamic URL that is being shown using the above global.
Thank you.
Vishal
-------------------------------------------------------