Search code examples
pythonploneploneformgen

Add content rule based on the form field value input data in Plone?


I create a form using PloneFormGen.eg. Product code: Gear-12 Value : 2000

Based on the input value i.e if Value is >5000 , move the saved data content entry to folder 1 else move the entry to folder 2.

How can the TALES expression be used to trigger this kind of content rule? I am using Plone ver 4.1


Solution

  • To be able to do this, you need to create 2 content rules--each with different conditions and destination folders to move the content to(using the "move to folder" action).

    In the content rules, add a TALES expression condition. Then do something like:

    python: request.form.get('value-to-check', False) == 'foobar'

    Obviously, you'll need to customize the expression a bit.