craft-dynamic-fields icon indicating copy to clipboard operation
craft-dynamic-fields copied to clipboard

Multi-Site functionality

Open maxstrebel opened this issue 2 years ago • 1 comments

First of all: thanks for this plugin. We're currently trying to use it for a "Theme" Dropdown. But it seems the CP does not share the currently active site anymore.

Each of our sites should be able to define custom themes, which then are output in the dropdown.

Unfortunately the queries always return the entries or globals for the default site. No matter on which site you're editing the entry.

I tried

{# Should return themes from the site in which I edit the entry #}
{% set themes = craft.entries.section("themes").all() %}

{# Should return global set in which I edit the entry - table with handle "customThemes", global Set with handle "themes" #}
{% set themes = themes.customThemes %}

{# I tried to reference the site in the backend #}
{% set themes = craft.globalSets()
  .handle("themes")
  .site(currentSite)
  .one()
%}

Do you know this problem?

maxstrebel avatar Apr 07 '22 15:04 maxstrebel

I just saw the Pull-request. Do you consider to merge this at some point?

maxstrebel avatar Apr 07 '22 16:04 maxstrebel