}
}
+ my $pager_shortcuts = $self->ctx->{get_org_setting}->(
+ $self->ctx->{physical_loc} || $self->ctx->{search_ou} ||
+ $self->ctx->{aou_tree}->id, 'opac.browse.pager_shortcuts'
+ );
+ if ($pager_shortcuts) {
+ my @pager_shortcuts;
+ while ($pager_shortcuts =~ s/(\*(.+?)\*)//) {
+ push @pager_shortcuts, [substr($2, 0, 1), $2];
+ }
+ push @pager_shortcuts, map { [$_, $_] } split //, $pager_shortcuts;
+ $self->ctx->{pager_shortcuts} = \@pager_shortcuts;
+ }
+
if ($self->cgi->param('qtype') and defined $self->cgi->param('bterm')) {
$self->leading_article_test(
'description'
),
'string', null)
+,( 'opac.browse.pager_shortcuts', 'opac',
+ oils_i18n_gettext(
+ 'opac.browse.pager_shortcuts',
+ 'Paging shortcut links for OPAC Browse',
+ 'coust',
+ 'label'
+ ),
+ oils_i18n_gettext(
+ '',
+ 'The characters in this string, in order, will be used as shortcut links for quick paging in the OPAC browse interface. Any sequence surrounded by asterisks will be taken as a whole label, not split into individual labels at the character level, but only the first character will serve as the basis of the search.',
+ 'coust',
+ 'description'
+ ),
+ 'string', null)
;
browse_xpath IS NULL AND
field_class = 'author';
+INSERT INTO config.org_unit_setting_type (
+ name, label, grp, description, datatype
+) VALUES (
+ 'opac.browse.pager_shortcuts',
+ 'Paging shortcut links for OPAC Browse',
+ 'opac',
+ 'The characters in this string, in order, will be used as shortcut links for quick paging in the OPAC browse interface. Any sequence surrounded by asterisks will be taken as a whole label, not split into individual labels at the character level, but only the first character will serve as the basis of the search.',
+ 'string'
+);
+
COMMIT;
\qecho This is a browse-only reingest of your bib records. It may take a while.
[% IF ctx.back_pivot %]
<a class="opac-button" href="[% mkurl('', {bpivot => ctx.back_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">← [%l ('Back') %]</a>
[% END %]
- [% IF browse.english_pager; # XXX how to apply i18n here?
+ [% IF ctx.pager_shortcuts;
current_qtype = CGI.param('qtype') || 'title' %]
<span class="browse-shortcuts">
- <a href="[% mkurl('', {qtype => current_qtype, bterm => '0'}, ['bpivot']) %]">0-9</a>
- [% FOR letter IN ['A'..'Z'] %]
- <a href="[% mkurl('', {qtype => current_qtype, bterm => letter}, ['bpivot']) %]">[% letter %]</a>
+ [% FOR shortcut IN ctx.pager_shortcuts %]
+ <a href="[% mkurl('', {qtype => current_qtype, bterm => shortcut.0}, ['bpivot']) %]">[% shortcut.1 %]</a>
[% END %]
</span>
[% END %]
</div>
[% END %]
- <ol class="browse-result-list">
+ <ul class="browse-result-list">
[% FOR result IN ctx.browse_results %]
<li class="browse-result">
<span class="browse-result-value[% result.row_number == 0 && !CGI.param('bpivot') ? ' browse-result-best-match' : '' %]">
# that h.target_count is only
# defined when h.target is.
- IF h.target %]
+ IF h.target AND h.target_count %]
<li><span class="browse-result-authority-field-name">[% field.name %]</span>
<a href="[% mkurl(ctx.opac_root _ '/results', {query => 'identifier|authority_id[' _ h.target _ ']'}) %]">[% h.heading | html %]</a>
<span class="browse-result-authority-bib-links">([% h.target_count %])</span>
#
# ctx.maintenance_message = "The system will not be available February 29, 2104.";
-# Browse settings
-# Set to 1 or 'true' to enable. This controls whether or not the
-# "0-9 A B C D ..." links appear on the browse page. We don't yet have a
-# serviceable way to internationalize these links, so sites must choose to
-# turn on this feature.
-
-browse.english_pager = 0;
-
%]
There are two off-by-default features that site administrators may wish
to enable.
- * Quick paging links (English): By changing the
- ''browse.english_pager'' setting to 1 in the
- ''opac/parts/config.tt2'' file for a site's active OPAC templates,
- you can make shortcut browsing links ''0-9 A B C D ...'' appear
- between the Back and Forward buttons on the browse page. I haven't
- figured out how to make this feature internationalizable, so it's
- off by default. You can turn it on if it works for your language,
- or have a look at improving it if it doesn't.
+ * Quick paging links: By adding a value for the org unit setting
+ ''opac.browse.pager_shortcuts'' , you can make shortcut browsing
+ links such as ''0-9 A B C D ...'' appear between the Back and Next
+ buttons on the browse page. The set of shortcuts should be chosen
+ based on the languages in use at your site, but a reasonable value
+ for English might be the string "*0-9*ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ which will yield a link for 0-9 and one for each letter A-Z. The
+ use of asterisks in the string group a shortcut whose label is more
+ than a single letter in length. Such longer shortcuts have the multi-
+ character string for the shortcut label, and the link just goes to the
+ first heading matching the first character of the label. The letters
+ not enclosed in asterisks just lead to individual letter shortcuts.
+
* There is a global flag by the name
''opac.browse.warnable_regexp_per_class'' to control what leading
enabled if it suits your catalog, and can even be customized per
search class (author, title, series, subject).
+Also, by default, authors are indexed for browse in such a way that
+relator roles like "creator" are dropped off the end of their headings.
+This was an aesthetic choice. If a site wanted to display those kinds
+of terms, they would update the 'config.metabib_field' table in
+the database, setting 'browse_xpath' to NULL where 'field_class' =
+''author'' and 'browse_field' is true.