Skip to content

What is the best to make plugin settings site specific? #16000

Closed Answered by brandonkelly
piotrpog asked this question in Q&A
Discussion options

You must be logged in to vote

The easiest way would be to have them set the setting value from config/<plugin-handle.php>, where they can set it to an array indexed by site handle. Then when you are fetching the value, run it through craft\helpers\ConfigHelper::localizedValue(), which will check if it’s an array, and if so, only return the value for the current site.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by brandonkelly
Comment options

You must be logged in to vote
1 reply
@brandonkelly
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants