245 ======================================================== |
245 ======================================================== |
246 |
246 |
247 Adding the following marker interface, we add new behavior to the Paragraph `ContactPhoneParagraph` . |
247 Adding the following marker interface, we add new behavior to the Paragraph `ContactPhoneParagraph` . |
248 |
248 |
249 |
249 |
250 Paragraph in the ZMI |
250 Paragraph advanced |
251 """""""""""""""""""" |
251 """""""""""""""""" |
252 |
252 |
253 1) Inner form |
253 You can attach Associated files, links or illustration and manage them directly through the rubric `Links and Attachments`. |
254 ------------- |
|
255 |
|
256 .. code-block:: python |
|
257 |
|
258 @adapter_config(context=(IContactPhoneParagraph, IPyAMSLayer), provides=IParagraphInnerEditor) |
|
259 @implementer(IInnerForm, IPropertiesEditForm, IAssociationParentForm) |
|
260 class ContactPhoneParagraphInnerEditForm(ContactPhoneParagraphPropertiesEditForm): |
|
261 """Contact paragraph inner edit form""" |
|
262 |
|
263 legend = None |
|
264 ajax_handler = 'inner-properties.json' |
|
265 |
|
266 |
|
267 Marker interfaces: |
|
268 |
|
269 :py:class:`IPropertiesEditForm` |
|
270 |
|
271 :py:class:`IAssociationParentForm` |
|
272 |
|
273 |
|
274 .. image:: _static/associations_form.png |
|
275 |
|
276 |
|
277 |
|
278 2) Inside a dedicated menu |
|
279 -------------------------- |
|
280 |
254 |
281 .. image:: _static/select_links_n_attachment.png |
255 .. image:: _static/select_links_n_attachment.png |
|
256 |
|
257 |
|
258 1) Paragraph with Links and Attachements |
|
259 ---------------------------------------- |
|
260 |
|
261 To "activate" this features the paragrath object must to implement specific interface |
282 |
262 |
283 |
263 |
284 .. code-block:: python |
264 .. code-block:: python |
285 |
265 |
286 @implementer(IContactPhoneParagraph, IIllustrationTarget,ILinkContainerTarget,IExtFileContainerTarget)) |
266 @implementer(IContactPhoneParagraph, IIllustrationTarget,ILinkContainerTarget,IExtFileContainerTarget)) |
288 class ContactPhoneParagraph(BaseParagraph): |
268 class ContactPhoneParagraph(BaseParagraph): |
289 """Contact paragraph""" |
269 """Contact paragraph""" |
290 ... |
270 ... |
291 |
271 |
292 |
272 |
293 Marker interfaces: |
273 These interfaces will allow to link other data to the paragraph. |
|
274 |
|
275 **Marker interfaces:** |
294 |
276 |
295 +--------------------------------+ |
277 +--------------------------------+ |
296 |:py:class:`IIllustrationTarget` | |
278 |:py:class:`IIllustrationTarget` | |
297 +===================+============+ |
279 +===================+============+ |
298 | | | |
280 | | | |
319 | +-------------------+ |
301 | +-------------------+ |
320 | | Add audio file | |
302 | | Add audio file | |
321 +----------------+-------------------+ |
303 +----------------+-------------------+ |
322 |
304 |
323 |
305 |
324 ZMI overview: |
306 **ZMI overview:** |
|
307 |
325 .. image:: _static/select_add_links.png |
308 .. image:: _static/select_add_links.png |
326 |
309 |
327 |
310 |
328 |
311 |
|
312 2) Add link and association form |
|
313 -------------------------------- |
|
314 |
|
315 You can add form to manage links and attachments directly in paragraph form to do that your form must implement |
|
316 ``IPropertiesEditForm`` and/or ``IAssociationParentForm`` |
|
317 |
|
318 |
|
319 .. code-block:: python |
|
320 |
|
321 @adapter_config(context=(IContactPhoneParagraph, IPyAMSLayer), provides=IParagraphInnerEditor) |
|
322 @implementer(IInnerForm, IPropertiesEditForm, IAssociationParentForm) |
|
323 class ContactPhoneParagraphInnerEditForm(ContactPhoneParagraphPropertiesEditForm): |
|
324 """Contact paragraph inner edit form""" |
|
325 |
|
326 legend = None |
|
327 ajax_handler = 'inner-properties.json' |
|
328 |
|
329 |
|
330 **Marker interfaces:** |
|
331 |
|
332 +-----------------------------------+ |
|
333 |:py:class:`IPropertiesEditForm` | |
|
334 +=========+=========================+ |
|
335 | | Add Illustration form | |
|
336 +---------+-------------------------+ |
|
337 |
|
338 +-----------------------------------+ |
|
339 |:py:class:`IAssociationParentForm` | |
|
340 +===========+=======================+ |
|
341 | | Add Association form | |
|
342 +-----------+-----------------------+ |
|
343 |
|
344 .. image:: _static/associations_form.png |
|
345 |