Skip to content

[Feature] Allow simple pseudo logic in patterns. #345

@douwepausma

Description

@douwepausma

Addon

No specific addon – This feature request is related to Webtools Core

Summary

Allow simple pseudo logic, like a shorthand if-else statement, to use fixed strings or other fields based on the value of the checked field. See suggested solution for an example.

Why is it needed?

In our case we have a vacancy content-type which has a toggle called volunteer that decides whether it's a payed position or not. We use the sames content-type as all the fields are in common. Some simple logic like the example below could be very use full in displaying the content under a different parent page. I can imagine other areas where this functionality could be useful as well.

Suggested solution(s)

# volunteer = true
# slug = barkeeper
/[volunteer ? 'volunteer' : 'careers']/[slug]
-> "/volunteer/barkeeper"

# volunteer = false
# slug = accountant
/[volunteer ? 'volunteer' : 'careers']/[slug]
-> "/careers/accountant"

Related issue(s)/PR(s)

Maybe this can be implemented in conjunction with #283

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions