Bug 14980 - Add a page showing one news
Summary: Add a page showing one news
Status: RESOLVED DUPLICATE of bug 14272
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-08 14:01 UTC by Fridolin Somers
Modified: 2019-08-08 07:12 UTC (History)
6 users (show)

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


Attachments
Bug 14980 - Add a page showing one news (4.25 KB, patch)
2015-10-08 15:29 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 14980 - Add a page showing one news (4.41 KB, patch)
2015-10-12 14:08 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14980 - Add a page showing one news (4.20 KB, patch)
2015-10-14 09:31 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 14980 - Add a page showing one news (4.33 KB, patch)
2015-10-14 16:32 UTC, Marc Véron
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2015-10-08 14:01:28 UTC
The news system allow to create rich HTML content on OPAC main page.

This enh proposes a new page that shows one of these new.

It allows to create custom pages a little bit like : 
http://wiki.koha-community.org/wiki/Koha_as_a_CMS
Comment 1 Fridolin Somers 2015-10-08 15:29:55 UTC Comment hidden (obsolete)
Comment 2 Fridolin Somers 2015-10-08 15:33:02 UTC
This patch is a POC, open to changes
Comment 3 Marc Véron 2015-10-12 14:07:16 UTC
Fridolin, I like the feature very much!

Thinking about enhancements (not necessarily for this bug, it is rather a wishlist):

- I would like to see the page id in the staff client (Home > Tools > News). The current column 'Number' could be renamed to 'Sort'.

- Flag news to display only as CMS page

- Flag news for "Display for logged in users only". Oh, and then, additionally flag news for certain user categories only

- Make it possible to include other news in a news. Let's say you have a 'news' with opening hours and an other one with the staff mebers. It would be nice to make them re-usable as page content inside other news. 

Marc

PS:
(One small thing in opac/opac-page.pl,line 2 says "This script lets the users change their privacy rules")
Comment 4 Marc Véron 2015-10-12 14:08:30 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2015-10-12 14:10:46 UTC
(In reply to Marc Véron from comment #3)

> - I would like to see the page id....
I mean the news id that is used to create the link.
Comment 6 Fridolin Somers 2015-10-14 09:27:15 UTC
(In reply to Marc Véron from comment #5)
> (In reply to Marc Véron from comment #3)
> 
> > - I would like to see the page id....
> I mean the news id that is used to create the link.

Indeed, I was thinking to even show the OPAC full url.
So one can copy/paste into OPACNav for example.
Comment 7 Fridolin Somers 2015-10-14 09:28:49 UTC
(In reply to Marc Véron from comment #3)
> 
> PS:
> (One small thing in opac/opac-page.pl,line 2 says "This script lets the
> users change their privacy rules")

Oups, copy/paste error, I change it
Comment 8 Fridolin Somers 2015-10-14 09:31:03 UTC Comment hidden (obsolete)
Comment 9 Fridolin Somers 2015-10-14 09:31:48 UTC
@Marc
Please re-signoff
Comment 10 Fridolin Somers 2015-10-14 09:38:21 UTC
(In reply to Marc Véron from comment #3)
> 
> - Flag news to display only as CMS page
> 
I think this is the first feat to develop.
Comment 11 Marc Véron 2015-10-14 16:32:54 UTC
Created attachment 43404 [details] [review]
Bug 14980 - Add a page showing one news

The news system allow to create rich HTML content on OPAC main page.

This enh proposes a new page that shows one of these new.

Test plan :
- Go to Tools > News
- Create a new entry
- Enter a title and a few content
- Save
- You see the new entry in table
- Note its number, for example 3
- Go to opac and enter URL : /cgi-bin/koha/opac-page.pl?id=3

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 12 Fridolin Somers 2015-10-15 12:58:36 UTC
> - Note its number, for example 3
This may not be clear : its the primary key, the id of the news.
Comment 13 Gaetan Boisson 2015-10-15 13:13:33 UTC
My two cents on what needs to go in before this can be integrated in master:

- easy access to the url of the page (as Fridolin suggested, a linkn column where you can copy the link with the news id would be perfect)
- ability to flag such pages as "CMS only", I would say this kind of page is definitely not going to appear in the news flow, but maybe some people will want to use it this way.
- make sure multiple languages are properly managed. This is trickier. If I build my menu in opacnav for instance, i will not be able to build a different menu, with different page ids, for different languages. So choosing OPAC (fr-FR) as the display location is not quite enough, because equivalent pages in each language will end up with different ids.
Comment 14 Marc Véron 2015-10-19 20:25:38 UTC
(In reply to Gaetan Boisson from comment #13)
(...)
> - make sure multiple languages are properly managed. This is trickier. If I
> build my menu in opacnav for instance, i will not be able to build a
> different menu, with different page ids, for different languages. So
> choosing OPAC (fr-FR) as the display location is not quite enough, because
> equivalent pages in each language will end up with different ids.

Gaetan, I think the translation handling could be based on or similar to 
Bug 14100 - Generic solution for language overlay
Comment 15 Katrin Fischer 2015-10-25 11:57:26 UTC
Comment on attachment 43404 [details] [review]
Bug 14980 - Add a page showing one news

Review of attachment 43404 [details] [review]:
-----------------------------------------------------------------

Some small issues, noted below, and 2 other things:

1) You can access internal news (staff interface) via guessing ids. (blocker)
2) The feature is too hidden for my taste as we don't even show the id internally. A link 'Show in OPAC' or similar could be helpful.

I'd also like to encourage you to talk to Viktor Sarge - I know he has been working on adding a 'Mini-CMS' feature to Koha and I think there are already some patches for small steps in that direction available on bugzilla.

::: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-page.tt
@@ +29,5 @@
> +
> +                    <div id="page-main">
> +                        <h4 class="newsheader">[% data.title | html %]</h4>
> +                        <div class="newsbody">[% data.new %]</div>
> +                        <div class="newsfooter">(published on [% data.expirationdate %])</div>

Please take a look at bugs 14246-14246 - it's a new feature that just passed QA that will allow to also display the author of a news.

::: opac/opac-page.pl
@@ +15,5 @@
> +# You should have received a copy of the GNU General Public License
> +# along with Koha; if not, see <http://www.gnu.org/licenses>.
> +
> +use strict;
> +use warnings;

Please always use Modern::Perl;

@@ +31,5 @@
> +    {
> +        template_name   => "opac-page.tt",
> +        query           => $query,
> +        type            => "opac",
> +        authnotrequired => 1,

Please check if this should be:
authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
Comment 16 Viktor Sarge 2015-10-26 09:41:54 UTC
Nice idea. I added Martin Persson to the CC-list since he has developed something similar during our project, but I'm not shure if there is any Buzilla thread for it. We want to expand the news with an news archive as well + some other patches making the news a plausible replacement for a separate blog.
Comment 17 Fridolin Somers 2016-11-24 07:26:10 UTC
This is just a POC, needs more work
Comment 18 Katrin Fischer 2019-07-13 10:06:15 UTC
Hi Frido, I feel this is a duplicate to bug 14272 and bug 15326, do you agree?

*** This bug has been marked as a duplicate of bug 14272 ***
Comment 19 Fridolin Somers 2019-08-08 07:12:23 UTC
(In reply to Katrin Fischer from comment #18)
> Hi Frido, I feel this is a duplicate to bug 14272 and bug 15326, do you
> agree?
> 
> *** This bug has been marked as a duplicate of bug 14272 ***

Yes thanks a lot :)