I’m using Plone v4.1.2, and I’d like to know if there a way to include more than one author in the by line of a page? I have two authors listed in ownership, but only one author is listed in the byline.
I’d like the byline to look something like this:
by First Author and Second Author — last modified Jan 11, 2012 01:53 PM — History
UPDATE – Thanks everyone for your replies. I managed to bungle my way through this (I’ve never used tal before). I edited plone.belowcontenttitle.documentbyline as suggested by Giaccamo, and managed to learn a bit about tal along the way. Here is the code that does what I needed (this replaces the existing tal:creator construct):
<span>
by
<span class="documentCreators"
tal:condition="context/Creators"
tal:repeat="creator context/Creators"
i18n:translate="text_creators">
<span tal:define="cond1 repeat/creator/start; cond2 repeat/creator/end"
tal:condition="python: not cond1 and not cond2" >, </span>
<span tal:define="cond1 repeat/creator/start; cond2 repeat/creator/end"
tal:condition="python: not cond1 and cond2" > and </span>
<tal:i18n i18n:translate="label_by_author">
<a href="#"
tal:attributes="href string:${context/@@plone_portal_state/navigation_root_url}/author/${creator}"
tal:content="creator"
tal:omit-tag="python:view.author() is None"
i18n:name="author">Roland Barthes</a>
</tal:i18n>
</span>
</span>
This puts the userid on the byline instead of the full name. I tried to get the full name, but after some time without success I decided I could live with userid.
In order to browse more than one author you’ll need a little bit of coding:
That piece of page is called
viewlets.That specific viewlet is called
plone.belowcontenttitle.documentbyline.You can use z3c.jbot to override the viewlet template. Take a look at this howto for usage. Another option is to customize the template through-the-web following this tutorial.