0

Is there any way to link to a global using a field in a entry form, much like you would use the "Entries" fieldtype to link to entries?

5

Not directly. You could have a dropdown of all the global set handles (use Dynamic Fields Plugin if you don't want to maintain this dropdown manually), and then in your template fetch the global set from its handle with getSetByHandle:

{% set globalSet = craft.globals.getSetByHandle(entry.globalSetHandle.value) %}
{% if globalSet %} {# could conceivably be null #}
  ... {{ globalSet.someField }} ...
{% endif %}
  • ZOMG, that is absolutely beautiful. Thanks Marion!! – John Jun 29 '15 at 18:28

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.