Package: collective.behavior.talcondition
collective.behavior.talconditionThis package works for dexterity (behavior) and archetypes (schema extender).It adds two fields on a content type or class:tal_condition : enter aTAL expressionthat once evaluated will return ‘True’ if content should be available. By default, elements ‘member’, ‘context’ and ‘portal’ are available for the expression but the TAL expression context may be extended using the ‘extra_expr_ctx’ parameter.roles_bypassing_talcondition : choose the different roles for which the TAL condition will not be evaluated and always considered 'True'It’s then possible to use the ‘evaluate’ method to test the TAL condition.How to use itFor AT you have to provide the ITALConditionable on your class (see testing.zcml).For DX you just have to activate the behavior on your content type.Plone versionsIt has been developed and tested for Plone 4 and 5.TranslationsThis product has been translated intoFrench.Spanish.You can contribute for any message missing or other new languages, join us atPlone Collective TeamintoTransifex.netservice with all world Plone translators community.Changelog0.14 (2021-06-29)Fix pypi broken package
[boulch]0.13 (2021-06-29)Add uninstall profile
[boulch]Add Plone6 compatibily
[boulch]0.12 (2021-04-20)Add Transifex.net service integration to manage the translation process.
[macagua]Add Spanish translation
[macagua]Do not consider thearchetypes.schemaextenderon Plone5.
[gbastien]Adapted code (except, implementer) to be Python3 compatible.
[gbastien]Added parametertrusted=Falsetoutils._evaluateExpression, this will use
a trusted expression handler instead the restricted python default.
[gbastien]0.11 (2019-05-16)Added parameterraise_on_errortoutils.evaluateExpressionForto raise an
error when an exception occurs instead returning False.
[gbastien]Added methodTALCondition.complete_extra_expr_ctxto the behavior to
formalize the way to getextra_expr_ctxto avoid theevaluatemethod
to be overrided.
[gbastien]0.10 (2018-11-20)Do not break if parameterexpressionpassed toutils._evaluateExpressionis None.
[gbastien]0.9 (2018-10-12)Added new parametererror_pattern=WRONG_TAL_CONDITIONtoutils.evaluateExpressionForand underlyingutils._evaluateExpressionto
be able to log a custom message in case an error occurs during
expression evaluation.
[gbastien]0.8 (2018-06-12)Mark elements using behavior withITALConditionableinterface so it behaves
like element using the AT extender.
[gbastien]0.7 (2017-03-22)Use CheckBoxWidget forITALCondition.roles_bypassing_talconditionto ease
selection when displaying several elements.
[gbastien]0.6 (2016-01-12)Added parameterempty_expr_is_trueto utils._evaluateExpression than may be True
or False depending that we want an empty expression to be considered True or False.
Previous behavior is kept in utils.evaluateExpressionFor where an empty expression
is considered True.  This avoid managing an empty expression in the caller method
[gbastien]0.5 (2015-12-17)Added method utils._evaluateExpression that receives an expression
to evaluate, it is called by utils.evaluateExpressionFor.  This way, this
method may evaluate a TAL expression without getting it from thetal_conditionattribute on the context, in case we want to evaluate arbitrary expression
[gbastien]0.4 (2015-09-16)Make the tal_condition field larger (from 30 to 80) for the
AT extender as well as for the DX behavior
[gbastien]Added possibility to extend TAL expression context by passing
anextra_expr_ctxdict to utils.evaluateExpressionFor, also
integrated to theevaluatemethod of the DX behavior
[gbastien]0.3 (2015-07-14)Corrected default value
[sgeulette]Little optimization
[sgeulette]0.2 (2015-06-18)Added fieldrole_bypassing_talconditionto define who can bypass the condition
[anuyens]Added translations for new field
[gbastien]0.1 (2015-06-01)Initial release.
[IMIO]