Bug 12645 - Extend Koha::Template::Plugin::Branches for use in masthead.inc
Summary: Extend Koha::Template::Plugin::Branches for use in masthead.inc
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-24 05:09 UTC by David Cook
Modified: 2023-07-15 20:38 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2014-07-24 05:09:04 UTC
At the moment, we're creating the OPAC branch pull-down from "BranchesLoop" which is passed from C4::Auth.

This seems a bit sub-optimal to me. I figure we should extend the Koha::Template::Plugin::Branches module so that it returns a loop with branch codes and branch names.
Comment 1 Katrin Fischer 2023-07-15 20:38:32 UTC
It appears this has been fixed, using the TT plugin for building the list:

[% IF ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
    <div class="col-sm col-md-3 col-lg-2 order-3 order-sm-4">
        <select name="limit" id="select_library" class="form-control">
            <option value="">All libraries</option>

            [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]

            [% FOREACH library IN Branches.all( selected => opac_name ) %]
                [% NEXT UNLESS library.public %]
                [% IF library.selected %]
                    <option selected="selected" value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
                [% ELSE %]
                    <option value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
                [% END %]
            [% END %]