Bug 13729 - Give news in Opac a unique anchor
This patch introduces the use of the idnew-value from the opac_news table as a base for a unique anchor on each newsitem in Opac. The anchor can be used for linking to specific newsitems and also for improving bug 7843 (RSS stream for news) with a unique link to each item in the RSS stream. Test plan: * Make shure you have a few news in the opac. Best is if it's enough to hide a few beneath the bottom of the window. * Install the patch. * Verify that you can access newitems with links like mykoha/cgi-bin/koha/opac-main.pl#newsitem4 * Experiment with removing newsitems and verify that that the newsitem-id stay unique to each newsitem. Signed-off-by: Magnus Enger <magnus@enger.priv.no> Works as advertised. Nice enhancement! Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Mason James <mtj@kohaaloha.com>
This commit is contained in:
parent
6ed6be043e
commit
75db3b4e17
|
|
@ -38,14 +38,14 @@
|
|||
[% END %]
|
||||
|
||||
[% IF ( koha_news_count ) %]
|
||||
<div id="news">
|
||||
<table class="table table-bordered">
|
||||
[% FOREACH koha_new IN koha_news %]
|
||||
<thead><tr><th>[% koha_new.title %]</th></tr></thead>
|
||||
<tbody><tr><td><p>[% koha_new.new %]</p>
|
||||
<p class="newsfooter"><i>(published on [% koha_new.newdate %])</i></p></td></tr></tbody>
|
||||
[% END %]
|
||||
</table>
|
||||
<div id="news" class="newscontainer">
|
||||
[% FOREACH koha_new IN koha_news %]
|
||||
<div class="newsitem">
|
||||
<a name="newsitem[% koha_new.idnew %]"></a><h4 class="newsheader">[% koha_new.title %]</h4>
|
||||
<div class="newsbody">[% koha_new.new %]</div>
|
||||
<div class="newsfooter">(published on [% koha_new.newdate %])</div>
|
||||
</div>
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue