[ic] next-anchor can't can't be "none" in more list

Bas Bezemer bas.bezemer at wxs.nl
Sun Mar 23 20:39:39 EST 2008


Dear list,

I'm sending my bug report to this list because i can't get trough to the bug reporting system.

In the procedure tag_more_list in Interpolate.pm no provision is made for the next-anchor being "none". Where it says something like:

  else {
   $next_anchor = qq%<img src="$next_anchor"$border>%;
  }
  $last = $next + $chunk - 1;
  $last = $last > ($total - 1) ? $total - 1 : $last;
  $arg = "$session:$next:$last:$chunk$perm";
  $hash{next_link} = more_link_template($next_anchor, $arg, $form_arg);

It should read something like the following to let it act like it should:

  elsif ($next_anchor ne 'none')  {
   $next_anchor = qq%<img src="$next_anchor"$border>%;
  }
  unless ($next_anchor eq 'none') {
   $arg = "$session:$next:$last:$chunk$perm";
   $hash{next_link} = more_link_template($next_anchor, $arg, $form_arg);
  }
  $last = $next + $chunk - 1;
  $last = $last > ($total - 1) ? $total - 1 : $last;

The reason why I want to get rid of al the next, last, first and previous links is because I want to construct a select pull down menu with pointers to the various page results (<select><option>1</option><option>2</option>...</select>)instead of the hyperlinked row of page links that can get uncontrolably long. With some small changes to tag_more_list i was able to do this.

In more_list i changed the following to have the selected page to fit in de select box:
 if($inc == $current) {
  $pa =~ s/__BORDER__/$border_selected || $border || ''/e;
#  $list .= qq|<strong>$pa</strong> | ;
  $list .= more_selected_template($pa, $arg, $form_arg) . ' ';
 }

Introduced the new function "more_selected_template"which is basically the same as more_link_template but with its own template string. The template string is defined as follows in tag_more_list:

 undef $selected_template;
 $r =~ s:\[selected[-_]template\]($All)\[/selected[-_]template\]::i
  and $selected_template = $1;
 $selected_template ||= q{<strong>$ANCHOR$</strong>};

right underneath where $link_template is defined. Works great.

Kind regards,
Bas



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.icdevgroup.org/pipermail/interchange-users/attachments/20080324/2b45e6b3/attachment.htm


More information about the interchange-users mailing list