Modifying the Document Byline
Quick Answer
In the ZMI, find the standard Document By Line template and customize it.
This template controls the item view
/site/portal_view_customizations/zope.interface.interface-plone.belowcontenttitle.documentbyline
Sample Code for adding Creation Date to the Item View
<span class="documentModified documentPublished">
—
<span i18n:translate="box_created">
created
</span>
<span tal:replace="python:view.toLocalizedTime(here.CreationDate(),long_format=1)">
August 16, 2001 at 23:35:59
</span>
</span>
And this template controls the standard listing of folder contents
/site/portal_skins/plone_content/folder_listing
Sample Code for adding Creation Date to teh folder contents view
<tal:modified condition="python: item_type != 'Event'"> — <tal:mod i18n:translate="box_created"> created </tal:mod> <span tal:replace="python:toLocalizedTime(item_created,long_format=1)"> August 16, 2001 at 23:35:59 </span> </tal:modified>
This is not the whole story.
Long Answer
http://plone.org/documentation/manual/theme-reference/elements/visibleelements/plone.belowcontenttitle.documentbyline
Plone 3 Theme Reference
Use with:
Plone 3
Relevant for:
Integrators, Customizers
This document was contributed to PLone.org by Anne Bowtell.
Also contributing: Rose Pruyne, Tjitske Kamphuis.
All content is copyright Plone Foundation and the individual contributors.
6.8.13. Byline
The 'about' information (who created a content item and when it was modified).
- Notes:
- You can turn off the Byline for anonymous viewers
- through the web: Site Setup > Security
- In your product: profiles/default/propertiestool.xml
- Snippet:
<div id="plone-document-byline" class="documentByLine">... </div>- CSS:
- public.css
- Name:
- plone.belowcontenttitle.documentbyline
- Type:
- viewlet
- Use:
- Site Setup > Zope Management Interface > portal_view_customizations
- Go to:
- plone.belowcontenttitle.documentbyline
Customizing through the Zope Management Interface
Customizing in your own product
The following details will help you locate the files that you will need to copy into your own product. They will also help you to provide the correct information to create your own zcml directives, Python classes, and interfaces.See viewlet for more information.
- Located in:
-
- [your egg location]/plone/app/layout/viewlets/
- [your egg location]/plone.app.layout-[version].egg/plone/app/layout/viewlets/
- Template Name:
- document_byline.pt
- Class Name:
- plone.app.layout.viewlets.content.DocumentBylineViewlet
- Manager:
- plone.belowcontenttitle (name)
plone.app.layout.viewlets.interfaces.IBelowContentTitle (interface)
Sample files & directives
Put a version of document_byline.pt in [your theme package]/browser/templates)
Create your own version of the class in [your theme package]/browser/[your module].py
from plone.app.layout.viewlets.content import DocumentBylineViewlet
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
class [your class name](DocumentBylineViewlet):
render = ViewPageTemplateFile("[your template name]")
Wire up your viewlet in [your theme package]/browser/configure.zcml
<browser:viewlet
name="[your namespace].[your viewlet name]"
manager="plone.app.layout.viewlets.interfaces.IBelowContentTitle"
class=".[your module].[your class name]"
layer=".interfaces.[your theme specific interface]"
permission="zope2.View"
/>
In [your theme package]/profiles/default/viewlets.xml
Hide the original viewlet (if you wish)
<object>
<hidden manager="plone.belowcontenttitle" skinname="[your skin name]">
<viewlet name="plone.belowcontenttitle.documentbyline" />
</hidden>
Insert your new viewlet in a viewlet manager
<order manager="plone.belowcontenttitle" skinname="[your skin name]"
based-on="Plone Default">
<viewlet name="[your namespace].[your viewlet name]"
insert-before="*" />
</order>
</object>