Skip to main content
1-Visitor
December 1, 2014
Solved

Node constraints defined in segment

  • December 1, 2014
  • 1 reply
  • 4526 views

Is there a way to constrain the options for Category that are available to a node by constraining it from the segment that uses it?

    Best answer by mrump

    Hi Nolin,

    this should be possible.

    You need to "map" the selected Category from the segment into the node Items.

    As there is no direct relationship to the segment for all levels of content, you cannot use a FVA; but a a computed field migth help.

    Something like :

    isEmpty(getFieldValue(DocumentID(), Category),Text("-unknown-"))

    should give you a Shorttext representation of the segment's Category value.

    Than you should be able to build a contraint based on that text field in the content type as intended.

    HTH Matthias

    1 reply

    mrump16-PearlAnswer
    16-Pearl
    December 2, 2014

    Hi Nolin,

    this should be possible.

    You need to "map" the selected Category from the segment into the node Items.

    As there is no direct relationship to the segment for all levels of content, you cannot use a FVA; but a a computed field migth help.

    Something like :

    isEmpty(getFieldValue(DocumentID(), Category),Text("-unknown-"))

    should give you a Shorttext representation of the segment's Category value.

    Than you should be able to build a contraint based on that text field in the content type as intended.

    HTH Matthias

    1-Visitor
    December 2, 2014

    Is there a way to get a property instead of a field? Something like getPropertyValue()?

    16-Pearl
    December 2, 2014

    If you can use a constraint of type "Rule", then you may be able to use the condition "Check a property associated with the item's type".