plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
254 stars 189 forks source link

Author information not available in multi-lingual sites #3277

Open thomasmassmann opened 3 years ago

thomasmassmann commented 3 years ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

What I did:

What I expect to happen:

What actually happened:

What version of Plone/ Addons I am using:

Possible solution

The author view is registered for IPloneSiteRoot:

  <browser:page
      for="Products.CMFPlone.interfaces.IPloneSiteRoot"
      name="author"
      class=".author.AuthorView"
      permission="zope.Public"
      template="templates/author.pt"
      />

Changing the registration to INavigationRoot will fix the 404 error in multi lingual sites:

  <browser:page
      for="plone.app.layout.navigation.interfaces.INavigationRoot"
      name="author"
      class=".author.AuthorView"
      permission="zope.Public"
      template="templates/author.pt"
      />

Calling the author view on the root Plone site will also show the author information. This is ok, but a redirect to the current language version would be better.

Some templates — like for the documents byline — already use the navigation root url (${context/@@plone_portal_state/navigation_root_url}/author/${creator_id}), not the plone site url. This is in my opinion the correct way.

Further notes

The registration and relevant code for the author information hasn’t been changed in years, so this applies to all current Plone versions (4.x - now).

cyriltata commented 2 years ago

Just faced this issue. @thomasmassmann did you implement your suggested solution?

thomasmassmann commented 2 years ago

Not yet 😞

cyriltata commented 2 years ago

Well I would just be going with portal_view_customizations for now. Like in the case of plone.belowcontenttitle.documentbyline using ${context/@@plone_portal_state/portal_url}/author/${creator_id} works