You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the Exclude From Navigation" is selected, that means it will be an option in each instance of the content type created. However, the creator of the content must manually go in and select the "hide from navigation" option.
suggest another Behavior option: "Always Exclude from Navigation". This will add the check box "exclude from navigation" however, this would be checked by default.
This allows the person creating the new content type to set the dessired default behavior
The text was updated successfully, but these errors were encountered:
We added a custom behavior for this in one project:
excl_from_nav.py:
"""A modified version of the plone.excludefromnavigation behavior
This one sets exclude_from_nav to True by default.
"""
from plone.autoform.interfaces import IFormFieldProvider
from plone.base import PloneMessageFactory as PMF
from plone.supermodel import model
from zope import schema
from zope.interface import provider
@provider(IFormFieldProvider)
class IExcludeFromNavigation(model.Schema):
"""Behavior interface to exclude items from navigation."""
exclude_from_nav = schema.Bool(
title=PMF("label_exclude_from_nav", default="Exclude from navigation"),
description=PMF(
"help_exclude_from_nav",
default="If selected, this item will not appear in the navigation tree",
),
default=True,
required=False,
)
configure.zcml:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:plone="http://namespaces.plone.org/plone"
>
<plone:behavior
name="myproject.excludefromnavigation"
title="Exclude From navigation"
description="Allow items to be excluded from navigation (default: True)"
provides=".exclude_from_nav.IExcludeFromNavigation"
/>
</configure>
It's too bad we don't have a good way to have a single behavior but then let the admin configure the default value of the field. I worry that having two different behaviors providing the same field would be confusing.
If the Exclude From Navigation" is selected, that means it will be an option in each instance of the content type created. However, the creator of the content must manually go in and select the "hide from navigation" option.
suggest another Behavior option: "Always Exclude from Navigation". This will add the check box "exclude from navigation" however, this would be checked by default.
This allows the person creating the new content type to set the dessired default behavior
The text was updated successfully, but these errors were encountered: