Skip to content

Commit

Permalink
Merge pull request #3477 from bolt/feature/relations-options-limit
Browse files Browse the repository at this point in the history
Allow setting a limit for the options displayed in relationships selects
  • Loading branch information
bobdenotter authored Oct 16, 2023
2 parents d75971c + b9bcf42 commit eda99e7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/content/_relationships.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{% set options = related_options(fromContentType, toContentTypeSlug, relation.order|default(), relation.format|default(), relation.required, relation.allow_empty, relation.link_to_record|default(false), ) %}
{% set value = record|related_values(toContentTypeSlug) %}

{% if limit is not defined %}
{% set limit = relation.get('limit')|default(2000) %}
{% endif %}

<div class="mb-4">

{# Print prefix #}
Expand All @@ -26,6 +30,7 @@
:name="'relationship[{{ toContentTypeSlug }}]'"
:id="'relationship-{{ toContentTypeSlug }}'"
:options="{{ options }}"
:optionslimit="{{ limit }}"
:multiple="{{ relation.multiple ? 'true' : 'false' }}"
:taggable=false
:autocomplete=true
Expand Down

0 comments on commit eda99e7

Please sign in to comment.