from Products.ATContentTypes.content import schemata from zope.component import getUtility from plone.registry.interfaces import IRegistry from msd.landingpage import landingpageMessageFactory as _ from msd.landingpage.interfaces import ILittleBlock from msd.landingpage.config import PROJECTNAME LittleBlockSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.IntegerField("weight", default=1, widget=atapi.IntegerWidget( label=_(u"Weight"), description=_(u"How many units of space are reserved for this block if container is horizontal.") ) ) )) # Set storage on fields copied from ATContentTypeSchema, making sure # they work well with the python bridge properties. LittleBlockSchema["description"].widget.visible = { "view" : "invisible", "edit" : "invisible"} schemata.finalizeATCTSchema(LittleBlockSchema, moveDiscussion=False) class LittleBlock(base.ATCTContent):
from msd.landingpage import landingpageMessageFactory as _ from msd.landingpage.interfaces import ILandingPage from msd.landingpage.config import PROJECTNAME from msd.landingpage.layout import Layout from msd.landingpage.widgets.layoutselection import LayoutSelectionWidget LandingPageSchema = folder.ATFolderSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( "blockLayout", vocabulary="getLayoutOptions", widget = LayoutSelectionWidget( label = _(u"Layout"), description="What kind of layout you wish to use on this landing page" ) ), )) # Set storage on fields copied from ATFolderSchema, making sure # they work well with the python bridge properties. LandingPageSchema['title'].storage = atapi.AnnotationStorage() LandingPageSchema['description'].storage = atapi.AnnotationStorage() schemata.finalizeATCTSchema( LandingPageSchema, folderish=True,
from msd.landingpage import landingpageMessageFactory as _ from msd.landingpage.interfaces import ISplashBlock from msd.landingpage.config import PROJECTNAME from msd.landingpage.content import littleblock SplashBlockSchema = littleblock.LittleBlockSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.TextField( "body", allowable_content_types=('text/html',), default_output_type='text/html', widget=atapi.RichWidget( label=_("Body text"), allow_buttons=( 'bg-basicmarkup', 'bold-button', 'italic-button', 'bg-drawers', 'linklibdrawer-button', 'linkdrawer-button', 'bg-list', 'list-ul-addbutton', ), ) ), atapi.StringField( 'colour',
from msd.landingpage import landingpageMessageFactory as _ from msd.landingpage.interfaces import IListingBlock from msd.landingpage.config import PROJECTNAME from msd.landingpage.content import littleblock ListingBlockSchema = topic.ATTopicSchema.copy() + littleblock.LittleBlockSchema.copy () + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.StringField( 'link', widget=atapi.StringWidget( label=_(u"Link"), description=_(u"Link for title and read more. http://www.google.com"), ), ), atapi.StringField( 'colour', widget=atapi.SelectionWidget( label=_(u"Colour"), description=_(u"Styling colour for the box"), format='select', ), vocabulary="getColoursVocabulary", ), atapi.StringField(
def getModesVocabulary(self): """ Returns search mode options """ return DisplayList(( ('0', _(u'Browse')), ('1', _(u'Search')) ))
from Products.DataGridField.Column import Column from msd.landingpage import landingpageMessageFactory as _ from msd.landingpage.interfaces import ISearchBlock from msd.landingpage.config import PROJECTNAME from msd.landingpage.content import littleblock SearchBlockSchema = littleblock.LittleBlockSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.BooleanField( 'showTitle', widget=atapi.BooleanWidget( label=_(u"Show block title?"), description=_(u"Untick to hide block's title"), ), default=True, ), atapi.StringField( 'search_mode', widget=atapi.SelectionWidget( label=_(u"Mode"), description=_(u"Select search mode: \"Browse\" - renders selection control and redirets to the content just after it's being selected and \"Search\" - renders text input field for searching by given value."), format='radio', ), default='0', required=True, vocabulary="getModesVocabulary",
from Products.Archetypes import atapi from Products.ATContentTypes.content import base from Products.ATContentTypes.content import schemata from msd.landingpage import landingpageMessageFactory as _ from msd.landingpage.interfaces import IHighlightBlock from msd.landingpage.config import PROJECTNAME from msd.landingpage.content import littleblock HighlightBlockSchema = littleblock.LittleBlockSchema.copy() + atapi.Schema( ( # -*- Your Archetypes field definitions here ... -*- atapi.BooleanField( "showTitle", widget=atapi.BooleanWidget(label=_(u"Show block title?"), description=_(u"Untick to hide block's title")), default=True, ), atapi.TextField( "body", allowable_content_types=("text/html",), default_output_type="text/html", widget=atapi.RichWidget( label=_("Body text"), allow_buttons=( "bg-basicmarkup", "bold-button", "italic-button", "bg-drawers", "linklibdrawer-button", "linkdrawer-button",