Ticket #8699 (closed PLIP: fixed)

Opened 5 years ago

Last modified 20 months ago

Make byline use the publication date if it exists

Reported by: limi Owned by: piv
Priority: major Milestone: 4.3
Component: General Version: 4.1
Keywords: Cc:

Description (last modified by piv) (diff)

Proposer: Vitaliy Podoba
Seconder: Laurence Rowe

Motivation

Adding publication date to byline viewlet would be a nice small feature useful to site visitors as well as content managers.

Assumptions

This feature will be optional and switched off by default. So there won't be any changes on the site until site manager will turn 'publication date' on in page byline.

Proposal & Implementation

Byline viewlet will be extended to display publication date. And we'll have 3 cases:

  • object not published: display only modification date (e.g. "published <date>")
  • object just published: display only publication date, because it'll also equal modification date (e.g. "last modified <date>")
  • object published and then modified: display both dates (e.g. "published <date>, last modified <date>")

Publication date will be taken from Effective Date field if it has been set. Otherwise we'll fallback to last 'publish' workflow transition date taken directly from workflow history.

To enable publication date in byline, there will be 'Display publication date in byline' checkbox in Security settings Control Panel.

Deliverables

  • updated plone.app.layout package where publication date will be inserted into byline viewlet + added more tests to viewlet
  • updated Products.CMFPlone package with a new property inside site_properties sheet: displayPublicationDateInByline (boolean, default: False), added tests
  • updated plone.app.controlpanel package to add displayPublicationDateInByline setting on Security Settings form; added tests
  • updated plone.app.locales with "Security Settings" panel new field strings
  • updated plone.app.upgrade to include displayPublicationDateInByline property addition to site properties property sheet
  • any documentation needs to be updated for this PLIP?

Risks

To get publication date from workflow history low level API will be used to avoid 'Review content' permission check and thus display publication date even to anonymous users. I don't think it's a risk because we provide this feature as optional, thus site manager is responsible for switching on publication date globally on the site.

Code will be bound to 'published' state and 'publish' workflow transition. So it usually won't work for custom workflows. Developers and integrators willing to have publication date working for their custom workflows will also have to customize byline viewlet.

Participants

Vitaliy Podoba (piv)

Progress

Most code is ready and available as addon:  http://pypi.python.org/pypi/collective.improvedbyline

Things left to do:

  • make publication date feature optional (update portal_properties tool and Security Settings form)
  • add new Security Settings form translation strings to plone.app.locales package
  • update documentation (if needed?)

Change History

comment:1 Changed 5 years ago by dunlapm

  • Keywords newbie added

comment:2 Changed 5 years ago by hannosch

  • Component changed from Content Types to Infrastructure

comment:3 Changed 4 years ago by kcraig

Is this something we actually want to do? I can either do this and commit to Plone or make an add-on Product for custom byline formatting.

Up to you guys.

comment:4 Changed 4 years ago by limi

I'm biased, but — yes, this is definitely something we still want. :)

comment:5 Changed 4 years ago by arrowman

Just adding my 2 cents.. Showing the first publication date of an article is important for copyright protection (at least it is in my jurisdiction). The "Published on Dec 27, 2008, updated Dec 29" looks good. So yes, I want this feature. I hope the text and dates will be i18able.

comment:6 Changed 4 years ago by kleist

A simplistic solution would be to add this just before the "documentModified" span in https://dev.plone.org/plone/browser/plone.app.layout/trunk/plone/app/layout/viewlets/document_byline.pt#L30

  <span class="documentPublished"
        tal:define="pub_date python:view.toLocalizedTime(context.EffectiveDate(),long_format=1)"
        tal:condition="pub_date">
    &mdash;
    <span i18n:translate="box_published">
      published
    </span>
    <span tal:replace="pub_date">
      August 16, 2001 at 23:35:59
    </span>
  </span>

... which would use Products.Archtypes.ExtensibleMetadata.EffectiveDate() https://dev.plone.org/archetypes/browser/Products.Archetypes/trunk/Products/Archetypes/ExtensibleMetadata.py#L348

However, can the solution be that simple? I suspect hidden issues...

comment:7 Changed 3 years ago by piv

  • Cc piv added

In case this task is still something we want to see in Plone core. I just released addon which implements above described functionality in Plone 4:  http://pypi.python.org/pypi/collective.improvedbyline . I can integrate it into Plone, let me know if it needs a PLIP.

comment:8 Changed 2 years ago by garbas

  • Status changed from new to confirmed
  • Type changed from Feature Request to Bug
  • Milestone changed from Future to 4.x

@piv ... could you make PLIP for this ... collective.improvedbyline looks nice to have in next plone version. if you hurry up, since you already have the implementation you can get in time to 4.3 release.

i suggest you just create PLIP out of this ticket.

comment:9 Changed 2 years ago by piv

  • Status changed from confirmed to new
  • Description modified (diff)
  • Cc piv removed
  • Component changed from Infrastructure to General
  • Summary changed from Make byline use be the publication date if it exists to Make byline use the publication date if it exists
  • Priority changed from minor to major
  • Owner set to piv
  • Version set to 4.1
  • Milestone changed from 4.x to 4.3
  • Keywords newbie removed
  • Type changed from Bug to PLIP

comment:10 Changed 2 years ago by piv

  • Description modified (diff)

comment:11 Changed 2 years ago by davisagli

The framework team approved this PLIP for implementation in our meeting on April 24. I think the next step is to complete the implementation in a branch of plone.app.layout, as well as the setting in a branch of plone.app.controlpanel. Please add a PLIP configuration in  https://github.com/plone/buildout.coredev/tree/4.3/plips so that we can easily evaluate the implementation, and let us know when it is ready for final review.

comment:12 Changed 2 years ago by piv

  • Description modified (diff)

comment:13 Changed 2 years ago by piv

  • Status changed from new to assigned

comment:14 Changed 2 years ago by piv

  • Status changed from assigned to confirmed

Dear Framework Team,

I finished the implementation of this PLIP and put some further notes here  https://github.com/plone/buildout.coredev/blob/4.3/plips/implementation_notes/plip8699-pubdate-byline.txt

Please, review and let me know what are my next steps.

Thank you!

comment:16 Changed 22 months ago by eleddy

soo... with respect to where to put the setting, there is going to be an integration with plone.app.workflowmanager this release, which in thory has a control panel. I think the setting would be mighty fine here. If there isn't a control panel option there, then lets put it in plone site control panel.

thanks!

comment:17 Changed 22 months ago by eleddy

btw feel free to merge after the setting has been moved!

comment:18 Changed 22 months ago by piv

So could I start now or better wait for the second review from Alec?

comment:19 Changed 22 months ago by eleddy

feel free to start now. Just please keep in mind moving the setting - we really don't want that to release because once its there people expect it :)

comment:20 Changed 22 months ago by piv

Merge and other fixes are applied. Please, find related notes inside this commit:  https://github.com/plone/buildout.coredev/commit/8f4d0110fd11e9b006cf225efa2233c861d85714

comment:21 follow-up: ↓ 22 Changed 22 months ago by alecm

I'm not too happy with this implementation, but perhaps I'm too late. My review is here:

 https://github.com/plone/buildout.coredev/blob/4.3/plips/reviews/plip8699-review-alecm.txt

Since it's merged, I'll create new (linked) tickets for the issues indicated.

comment:22 in reply to: ↑ 21 Changed 21 months ago by piv

Replying to alecm:

I'm not too happy with this implementation, but perhaps I'm too late. My review is here:

 https://github.com/plone/buildout.coredev/blob/4.3/plips/reviews/plip8699-review-alecm.txt

Since it's merged, I'll create new (linked) tickets for the issues indicated.

Thank you for your review.

I'm also up for the simplest possible approach: always display effective date if set and if it was enabled in control panel. If we pick this approach then the other issues you mentioned in your review (like workflow states, security issues, etc...) will also be gone.

So I can update the code directly inside plone.app.layout if you let me start w/o new tickets.

Regarding control panel setting: eleddy suggested to put it there inside Site Settings and I also like having this setting inside Site Settings rather than inside Themes panel. Please, agree with eleddy where to put that field eventually.

comment:23 Changed 20 months ago by esteele

  • Status changed from confirmed to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.