0

We want to have a playa field in a front end standalone entry form (SAEF).

However we want the related entry to be automatically be selected based on the entry ID in a segment.

If an entry ID is not present then we would have the usual playa field selection so that hete user could manually select a related entry.

Is this possible?

  • If the ID is present, do you still want to show the full Playa field? Or just have a hidden input that will result in that entry getting selected on save, without being customizable? – Brandon Kelly Feb 18 '15 at 14:14
  • @BrandonKelly I really do not mind, as long as the relationship is added and the entries related... and as long as it it viewable/editable to CMS Admin staff. – paulcripps Feb 18 '15 at 16:17
1

You can do that like this:

{if segment_3}
    <input type="hidden" name="playa_field_name[selections][]" value="{segment_3}">
{if:else}
    {field:playa_field_name}
{/if}

Replace 3 with whatever URL segment the entry ID will actually be in, and playa_field_name with your actual Playa field short name.

| improve this answer | |

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.