Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Multi-site widgets #9600

Merged
merged 3 commits into from Mar 18, 2024
Merged

Conversation

aerni
Copy link
Contributor

@aerni aerni commented Feb 27, 2024

This PR adds the ability to only show widgets on certain sites. One scenario where this is useful is when you have a collection widget and the collection is only available on one site. Without this PR, the collection widget would just be empty and useless on the site the collection isn't configured for.

You can configure the sites like follows. If the sites key is missing, the widget will be shown on all the sites.

'widgets' => [
  [
    'type' => 'collection',
    'collection' => 'events',
    'limit' => 10,
    'sites' => ['gounity'],
  ],
]

I was going to add a test for this, but wasn't sure how to approach it, as I couldn't find any tests for controllers.

@aerni aerni closed this Feb 27, 2024
@aerni aerni deleted the feature/multisite-widgets branch February 27, 2024 17:07
@aerni aerni restored the feature/multisite-widgets branch February 27, 2024 17:12
@duncanmcclean
Copy link
Member

Did you mean to close this?

@aerni
Copy link
Contributor Author

aerni commented Feb 27, 2024

Nope. No idea what happened. Can you open it again?

@aerni aerni reopened this Feb 27, 2024
@aerni
Copy link
Contributor Author

aerni commented Feb 27, 2024

Ah, there we go. It was able to open it myself.

@jasonvarga jasonvarga merged commit bca6754 into statamic:4.x Mar 18, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants