Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/+widget.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add new widget for seo title and description. @iFlameing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iFlameing @sneridagh this changelog entry says "Add new". How come this is a bugfix and has been released as a bugfix release? If we manage our releases that way, we will piss off our devs who upgrade and our clients who see new features without a heads-up.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw that this requires a new version of VLT. The feature alone might be worth a major version bump. I honestly don't get how so many people can check and discuss this PR an no one sees this. cc @ericof

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the tone folks. Had a bad morning...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tisto you can read the discussion in the PR where I pointed this out and carefully tested to make sure the add-on still works (without the new widget) with older versions of VLT. It is not breaking.

You're right that it should have been a minor release and marked as a feature though.

21 changes: 19 additions & 2 deletions src/kitconcept/seo/behaviors/seo.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
)
Expand Down