Currently the news for display are fetched in the script, if we move this to the template, bug 28955 will allow displaying branch news by default on home page
Created attachment 128506 [details] [review] Bug 29691: Use template to display news on opac homepage This patch moves the fetching of news to the template and adds a p[lugin method to get news by id TO test: 1 - Define some general and library specific news items 2 - Define in various languages 3 - Define some 'Additional contents' as well 4 - Apply patch 5 - Confirm onlly 'all libraries' news show if not loigged in to opac 6 - Confirm correct library news show when logged in 7 - View specific news items: http://localhost:8080/cgi-bin/koha/opac-main.pl?news_id=12 8 - Confirm that non-existent ids show " This news item does not exist. " 9 - Confirm if you enter ID for additional contents you get 'does not exist'
Created attachment 128508 [details] [review] Bug 29691: Use template to display news on opac homepage This patch moves the fetching of news to the template and adds a p[lugin method to get news by id TO test: 1 - Define some general and library specific news items 2 - Define in various languages 3 - Define some 'Additional contents' as well 4 - Apply patch 5 - Confirm onlly 'all libraries' news show if not loigged in to opac 6 - Confirm correct library news show when logged in 7 - View specific news items: http://localhost:8080/cgi-bin/koha/opac-main.pl?news_id=12 8 - Confirm that non-existent ids show " This news item does not exist. " 9 - Confirm if you enter ID for additional contents you get 'does not exist' Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Nice work Nick.. signing off :)
Missing POD and tests.
113 [% IF ( news_item ) %] 114 • <a href="/cgi-bin/koha/opac-main.pl">Show all news</a> 115 [% END %] This is not displayed.
The news is not displayed in the translated version of the interface (does not seem related to this patch however).
Do you intend to revisit this Nick?
Created attachment 149903 [details] [review] Bug 29691: Use template to display news on opac homepage This patch moves the fetching of news to the template and adds a p[lugin method to get news by id TO test: 1 - Define some general and library specific news items 2 - Define in various languages 3 - Define some 'Additional contents' as well 4 - Apply patch 5 - Confirm onlly 'all libraries' news show if not loigged in to opac 6 - Confirm correct library news show when logged in 7 - View specific news items: http://localhost:8080/cgi-bin/koha/opac-main.pl?news_id=12 8 - Confirm that non-existent ids show " This news item does not exist. " 9 - Confirm if you enter ID for additional contents you get 'does not exist'
Created attachment 149904 [details] [review] Bug 29691: Unit tests
Created attachment 149932 [details] [review] Bug 29691: Use template to display news on opac homepage This patch moves the fetching of news to the template and adds a p[lugin method to get news by id TO test: 1 - Define some general and library specific news items 2 - Define in various languages 3 - Define some 'Additional contents' as well 4 - Apply patch 5 - Confirm onlly 'all libraries' news show if not loigged in to opac 6 - Confirm correct library news show when logged in 7 - View specific news items: http://localhost:8080/cgi-bin/koha/opac-main.pl?news_id=12 8 - Confirm that non-existent ids show " This news item does not exist. " 9 - Confirm if you enter ID for additional contents you get 'does not exist' Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 149933 [details] [review] Bug 29691: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
All working as described, thanks Nick. Signing off :)
Created attachment 151481 [details] [review] Bug 29691: Use template to display news on opac homepage This patch moves the fetching of news to the template and adds a p[lugin method to get news by id TO test: 1 - Define some general and library specific news items 2 - Define in various languages 3 - Define some 'Additional contents' as well 4 - Apply patch 5 - Confirm onlly 'all libraries' news show if not loigged in to opac 6 - Confirm correct library news show when logged in 7 - View specific news items: http://localhost:8080/cgi-bin/koha/opac-main.pl?news_id=12 8 - Confirm that non-existent ids show " This news item does not exist. " 9 - Confirm if you enter ID for additional contents you get 'does not exist' Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 151482 [details] [review] Bug 29691: Unit tests Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 23.11. Nice work everyone, thanks!
Too bad that this has been revived before bug 31383 was pushed...
Enhancement.. one I've been wanting for a while.. but not one for 23.05.x I feel.
This seems like a code refactor thing. I don't think there's anything to be added or changed in the manual.