File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
src/kitconcept/seo/behaviors Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1+ Add new widget for seo title and description. @iFlameing
Original file line number Diff line number Diff line change 11from kitconcept .seo import _
2+ from plone .autoform import directives
23from plone .autoform .interfaces import IFormFieldProvider
34from plone .dexterity .interfaces import IDexterityContent
45from plone .namedfile .field import NamedBlobImage
@@ -28,20 +29,36 @@ class ISeo(model.Schema):
2829 ],
2930 )
3031
32+ directives .widget (
33+ "seo_title" ,
34+ frontendOptions = {
35+ "widget" : "softTextWidget" ,
36+ "widgetProps" : {"softMaxLength" : "55" },
37+ },
38+ )
39+
3140 seo_title = schema .TextLine (
3241 title = _ ("Title" ),
3342 description = _ (
3443 "Override the meta title. When empty the default title will "
35- + "be used. Use maximum 50 characters."
44+ + "be used. Use maximum 55 characters."
3645 ),
3746 required = False ,
3847 )
3948
49+ directives .widget (
50+ "seo_description" ,
51+ frontendOptions = {
52+ "widget" : "softTextareaWidget" ,
53+ "widgetProps" : {"softMaxLength" : "155" },
54+ },
55+ )
56+
4057 seo_description = schema .TextLine (
4158 title = _ ("Description" ),
4259 description = _ (
4360 "Override the meta description. When empty the default "
44- + "description will be used. Use maximum 150 characters."
61+ + "description will be used. Use maximum 155 characters."
4562 ),
4663 required = False ,
4764 )
You can’t perform that action at this time.
0 commit comments