...
intl-whitelabel-cms:
Create a new item
boolean
toenable
ordisable
thecomplementaryCta:
Where: upside
complementaryCta
;Code Block language typescript { title: 'Show Complementary CTA', description: 'By checking this, it show the complementary CTA', name: 'showComplementaryCTA', type: 'boolean', },
Change the
complementaryCta
:from:
Code Block language typescript { title: 'Complementary CTA', name: 'complementaryCta', type: 'linkAction', validation: (Rule: RuleType) => Rule.required(), },
to:
Code Block language typescript { title: 'Complementary CTA', name: 'complementaryCta', type: 'linkAction', validation: (Rule: RuleType) => { return Rule.required().custom((showComplementaryCTA, context) => { const showComplementaryText = !!(context.document.complementaryCta?.actionText || {})[ defaultLanguage ]; const showComplementaryAction = !!(context.document.complementaryCta?.actionUrl || {})[ defaultLanguage ]; if (showComplementaryCTA && !(showComplementaryText || showComplementaryAction)) { return 'If you want to enable the complementary CTA button, you must either provide "Action Text" and add a "Action url"'; } return true; }); }, },
...