src/source/howto-paragraph.rst
branchdoc-dc
changeset 78 88a65b19d07d
parent 77 ae0e104800aa
child 83 ee94d17857a4
equal deleted inserted replaced
77:ae0e104800aa 78:88a65b19d07d
     1 .. _paragraphhowto:
     1 .. _paragraphhowto:
     2 
     2 
     3 
     3 
     4 How to create a new paragraph type?
     4 How to create a new Paragraph type?
     5 ===================================
     5 ===================================
     6 
     6 
     7 Paragraphs are components or blocs that contain elements/fields and provide one or many renderer methods to compose
     7 Paragraphs are components or blocs that contain elements/fields and provide one or many renderer methods to compose
     8 the front office website
     8 the front office website
     9 
     9 
    72             self._photo = value
    72             self._photo = value
    73             if IImage.providedBy(self._photo):
    73             if IImage.providedBy(self._photo):
    74                 alsoProvides(self._photo, IResponsiveImage)
    74                 alsoProvides(self._photo, IResponsiveImage)
    75 
    75 
    76 
    76 
    77 3) renderers Vocabulary
    77 3) Renderers Vocabulary
    78 ----------------------
    78 ----------------------
    79 
    79 
    80 The list of rendered available for a paragraph is build automatically and is based on adapters that provide this interface
    80 The list of rendered available for a paragraph is build automatically and is based on adapters that provide this interface
    81 
    81 
    82 .. code-block:: python
    82 .. code-block:: python
   196 
   196 
   197 4) Create ZMI Edit form inner tab
   197 4) Create ZMI Edit form inner tab
   198 ---------------------------------
   198 ---------------------------------
   199 
   199 
   200 .. code-block:: python
   200 .. code-block:: python
       
   201 
   201     @adapter_config(context=(IContactPhoneParagraph, IPyAMSLayer), provides=IParagraphInnerEditor)
   202     @adapter_config(context=(IContactPhoneParagraph, IPyAMSLayer), provides=IParagraphInnerEditor)
   202     @implementer(IInnerForm)
   203     @implementer(IInnerForm)
   203     class ContactPhoneParagraphInnerEditForm(ContactPhoneParagraphPropertiesEditForm):
   204     class ContactPhoneParagraphInnerEditForm(ContactPhoneParagraphPropertiesEditForm):
   204         """Contact paragraph inner edit form"""
   205         """Contact paragraph inner edit form"""
   205 
   206