1

I have an entry field that is a selector tool for the page call to action at the bottom.

I have a channel of four or five entries and I'd like one of them to be the default selection so it's one less thing to setup on a site full of pages.

I haven't seen any details or questions for this sort of request as of yet so I thought I'd ask the question.

Thanks, Jay

2

Entry fields do not natively support setting a default entry, but you can use the Globals section to achieve the same effect.

Create a 'Default Call to Action Entry' field in your globals, and set the default entry for all pages there. For extra functionality, I would then also have a 'Call to Action Entry' field on your entries.

With this set-up, a user can select a custom entry to use on that entry if they want, but by default it will fall-back to the entry selected in the Globals.

Your template would look something like this:

{% set ctaEntry = entry.callToActionEntry.one|default('globalHandle.defaultCallToActionEntry.one') %}

If you didn't want to build the ability to override the default entry on a per-page basis, you can just use the field in the Globals:

{% set ctaEntry = globalHandle.defaultCallToActionEntry.one %}

|improve this answer|||||
  • Beautiful idea, mate. I'll give that a go, cheers! – Jay Nov 14 '18 at 18:45
  • This worked a charm, by the way! – Jay Dec 14 '18 at 12:33
  • @Jay Glad to help :-) – Jamie Wade Dec 14 '18 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.