99# from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
1010from cs_dynamicpages .utils import get_available_views_for_row
1111from cs_dynamicpages import _
12+ from Products .statusmessages .interfaces import IStatusMessage
1213
1314class IDynamicPageFolderView (Interface ):
1415 """Marker Interface for IDynamicPageFolderView"""
@@ -43,7 +44,10 @@ def __call__(self):
4344 container = self .context ,
4445 row_type = row_type ,
4546 title = "New Row" ,
46- id = str (random_id )
47+ description = "Here goes the description" ,
48+ id = str (random_id ),
49+ link_text = "Link Text" ,
50+ link_url = "/" ,
4751 )
4852 available_views = get_available_views_for_row ()
4953 for view in available_views :
@@ -52,28 +56,30 @@ def __call__(self):
5256 if has_featured_button :
5357 created_elements_find = api .content .find (
5458 portal_type = "DynamicPageRow" ,
55- id = str (random_id )
59+ id = str (random_id ),
5660 )
5761 created_element = created_elements_find [0 ].getObject ()
5862 random_id_featured = uuid4 ()
5963 api .content .create (
6064 type = "DynamicPageRowFeatured" ,
6165 container = created_element ,
6266 title = "New Featured" ,
63- id = str (random_id_featured )
67+ description = "Here goes the description" ,
68+ id = str (random_id_featured ),
69+ link_text = "Link Text" ,
70+ link_url = "/" ,
6471 )
6572
6673 random_id_featured_2 = uuid4 ()
6774 api .content .create (
6875 type = "DynamicPageRowFeatured" ,
6976 container = created_element ,
7077 title = "New Featured 2" ,
71- id = str (random_id_featured_2 )
78+ description = "Here goes the description" ,
79+ id = str (random_id_featured_2 ),
80+ link_text = "Link Text" ,
81+ link_url = "/" ,
7282 )
7383 statusmessage = _ ("Row added successfully" )
74- api .portal .show_message (
75- message = statusmessage ,
76- request = self .request ,
77- type = "info"
78- )
84+ IStatusMessage (self .request ).add (statusmessage , type = "info" )
7985 return self .request .response .redirect (f"{ self .context .absolute_url ()} #{ str (random_id )} " )
0 commit comments