collective.referencedatagridfield

collective.referencedatagridfield is a mix of Reference and DataGrid fields for Plone.

collective.referencedatagridfield

This is a sophisticated reference field with its own widget for adding and deleting references for both internal and external resources. Having complete support for Archetype's Reference field functionality, it also allows external links management.

This package functionality is based on DataGridField, DataGridWidget and Archetype's Reference field with ATReferenceBrowserWidget. It allows Plone developers to extend default Plone Reference field functionality or override existing Reference field functionality with a custom one.

Required Products.DataGridField package is automatically installed during installation procedure.

Usage

This package can be used for extending Plone default Related content functionality. Apart from possibility to add related items from the current website, collective.referencedatagridfield allows to:

  • add custom title to the related item instead of its real title
  • add external sources as related items

Use Case

There is an example of simple content type creation with a mix of Reference and DataGrid fields as related items included into the package.

from AccessControl import ClassSecurityInfo

from Products.Archetypes.public import *
from Products.ATContentTypes.content.base import ATCTContent


from collective.referencedatagridfield import PKG_NAME
from collective.referencedatagridfield import ReferenceDataGridField
from collective.referencedatagridfield import ReferenceDataGridWidget

class ReferenceDataGridDemoType(ATCTContent):
""" Simple ReferenceDataGridField demo."""
security = ClassSecurityInfo()
schema = BaseSchema + Schema((

ReferenceDataGridField('demo_rdgf',
schemata='default',
relationship="demo_relation",
widget = ReferenceDataGridWidget(
label = "Reference DataGrid Field(s)",
visible = {'edit' : 'visible', 'view' : 'visible'}
)
),
))

meta_type = portal_type = archetype_name = 'ReferenceDataGridDemoType'

registerType(ReferenceDataGridDemoType, PKG_NAME)

This example adds a new simple content type to Plone - ReferenceDataGridDemoType with title field and possibility to add related items - both from the current site and external ones.

Internal Links

To insert internal link use 'Add...' button and browse your site for the necessary object you want to add. Type in desirable title into the Title field. If you leave it empty - it will automatically be filled with the inserted object title.

External Links

To insert external links simply type in external URL into the Links field. Please type in full address with http:// protocol. In case your URL is not correct it will not be saved. Type in desirable title into the Title field. If you leave it empty - it will get title the same as URL.

As a result your content type will have internal and external related items.

Development

This product was developed by Quintagroup for Plone collective sponsored by Headnet company.

Supported Plone Versions

This product was developed and tested with Plone 4.0.

Links

Help us improve

With your help we will continue develop and improve this product in the future:

  1. Leave a testimonial for us to know that you like our product
  2. If you are interested in contributing to this product please submit this form and we will provide you with SVN access
  3. Order product customization or its implementation on your website
Follow