Bug 29609: Centralized code to build the link to a biblio detail page
[srvgit] / koha-tmpl / opac-tmpl / bootstrap / en / includes / html_helpers.inc
index 8cb9d2f..d849154 100644 (file)
@@ -9,14 +9,27 @@
 [% END %]
 
 [% BLOCK koha_news_block %]
-    [% IF ( news.size > 0 ) %]
-        [% FOREACH n IN news %]
-            <div class="[% n.lang | html %]_item">
-                [% IF ( n.title ) %]
-                    <h4 class="[% n.lang | html %]_header">[% n.title | html %]</h4>
-                [% END %]
-                <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
-            </div>
-        [% END %]
+    [% IF ( news.content && news.content.count > 0 ) %]
+        <div id="[% news.location | html %]">
+            [% FOREACH n IN news.content %]
+                <div class="[% n.lang | html %]_item">
+                    [% IF ( n.title && news.blocktitle ) %]
+                        <h4 class="[% n.lang | html %]_header">[% n.title | html %]</h4>
+                    [% END %]
+                    <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
+                </div>
+            [% END %]
+        </div>
     [% END %]
 [% END %]
+
+[% BLOCK biblio_a_href -%]
+    [%- IF Koha.Preference('BiblioDefaultView') == 'marc' -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=" -%]
+    [%- ELSIF Koha.Preference('BiblioDefaultView') == 'isbd' -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=" -%]
+    [%- ELSE -%]
+        [%- SET this_biblio_href = "/cgi-bin/koha/opac-detail.pl?biblionumber=" -%]
+    [%- END -%]
+    [%- this_biblio_href | url %][% biblionumber | url -%]
+[%- END %]