From 3935c696d186a0192f00a53c06e7aca61593f4ea Mon Sep 17 00:00:00 2001 From: iFlameing Date: Fri, 2 Jan 2026 20:09:05 +0530 Subject: [PATCH 1/2] Add new widget for title and description --- news/+widget.bugfix | 1 + src/kitconcept/seo/behaviors/seo.py | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 news/+widget.bugfix diff --git a/news/+widget.bugfix b/news/+widget.bugfix new file mode 100644 index 0000000..ab962dd --- /dev/null +++ b/news/+widget.bugfix @@ -0,0 +1 @@ +Add new widget for seo title and description. @iFlameing \ No newline at end of file diff --git a/src/kitconcept/seo/behaviors/seo.py b/src/kitconcept/seo/behaviors/seo.py index d5a4f89..14311cf 100644 --- a/src/kitconcept/seo/behaviors/seo.py +++ b/src/kitconcept/seo/behaviors/seo.py @@ -1,4 +1,5 @@ from kitconcept.seo import _ +from plone.autoform import directives from plone.autoform.interfaces import IFormFieldProvider from plone.dexterity.interfaces import IDexterityContent from plone.namedfile.field import NamedBlobImage @@ -28,20 +29,36 @@ class ISeo(model.Schema): ], ) + directives.widget( + "seo_title", + frontendOptions={ + "widget": "soft_text_widget", + "widgetProps": {"softMaxLength": "55"}, + }, + ) + seo_title = schema.TextLine( title=_("Title"), description=_( "Override the meta title. When empty the default title will " - + "be used. Use maximum 50 characters." + + "be used. Use maximum 55 characters." ), required=False, ) + directives.widget( + "seo_description", + frontendOptions={ + "widget": "soft_text_area_widget", + "widgetProps": {"softMaxLength": "155"}, + }, + ) + seo_description = schema.TextLine( title=_("Description"), description=_( "Override the meta description. When empty the default " - + "description will be used. Use maximum 150 characters." + + "description will be used. Use maximum 155 characters." ), required=False, ) From 5584188117e3f7309a7d4bd76c8862cce59e8a0c Mon Sep 17 00:00:00 2001 From: Tisha Soumya Date: Wed, 21 Jan 2026 19:51:16 +0530 Subject: [PATCH 2/2] fix the widget names --- src/kitconcept/seo/behaviors/seo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kitconcept/seo/behaviors/seo.py b/src/kitconcept/seo/behaviors/seo.py index 14311cf..aaf612c 100644 --- a/src/kitconcept/seo/behaviors/seo.py +++ b/src/kitconcept/seo/behaviors/seo.py @@ -32,7 +32,7 @@ class ISeo(model.Schema): directives.widget( "seo_title", frontendOptions={ - "widget": "soft_text_widget", + "widget": "softTextWidget", "widgetProps": {"softMaxLength": "55"}, }, ) @@ -49,7 +49,7 @@ class ISeo(model.Schema): directives.widget( "seo_description", frontendOptions={ - "widget": "soft_text_area_widget", + "widget": "softTextareaWidget", "widgetProps": {"softMaxLength": "155"}, }, )