Instant Low Variable set for new sites using Multiple Site Manager
This is something that an existing project I'm doing that uses both Low Variables and Multiple Site Manager could really use. It's a tall order based on what exists now, but I think this would be so cool if this could one day be implemented into Low Variables when using Multiple Site Manager.
Right now, when making a new MSM site, you can copy "global variables" from an existing site into your new site. However, if you're using Low Variables, then you lose the variable groups, the variable formatting, field types, early parsing, etc.
Low Variables already lets you clone variables one-by-one. I think it would be sweet if Low Variables just had its own "clone global variables" function when MSM was installed. So, when making a new site, you wouldn't copy over global variables using MSM's built in function, but go to Low Variables and do this.
Ideally, you would have the following options:
— copy Variables from site _____ to site ______
— copy all of an existing site's variables, or just a group (check boxes)
— copy variable groups, parsing order, field types, field lengths (check boxes, already selected)
— when copying variables to new site, optionally find and replace a string in the variable name, i.e.. change _edmonton to _toronto
— when copying variables to new site, optionally find and replace a string in the field label
— when copying variables to new site, optionally find and replace a string in the field description
So, with these options, you could easily create a readymade control panel for the new site based on an existing site in your MSM setup.
Replies
David 10 Aug 2011 21:19
I hit this problem recently and wrote a quick and dirty CI app to fully copy Low Variables between MSM sites. Works a treat.
Until Ellislab adds the necessary hook to EE, this is the best we can hope for.
oxygensmith 10 Aug 2011 23:05
Oooh, is that easily modifiable? even if it made things slightly easier it would be worth a PayPal donation for sure... :)
Low 11 Aug 2011 07:27
Cloning or export/import variables has been requested before, and I have looked into it a while back. Like David says, there aren't hooks in place to trigger duplicating vars when you create a new site in the MSM. Therefore, a custom copy method would be needed.
Which brings all sorts of other tricky issues. For normal types like textarea and such, it's fairly easy. But for types that make use of the site's channels, categories and files, it's harder; you can't just copy a Select Entries var type over to a new site, unless you 'reset' the var. It's stuff like that that I have to think through.
But your request is noted!
trif3cta 4 Nov 2011 20:48
We have 60+ Low Vars we need to clone across 20 sites, so we wrote a query. Use at your own risk - this may be dangerous depending on the Fieldtypes you're using.