Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Cannot use a sc.variable in a patch file to change the location of generated classes #27
I'm trying to use a variable defined in a dev patch file that allows the dev to specify the source root folder. We don't use the webroot as the source root. Unicorn let's me do this. With Synthesis it is passed along as a string.
This is caused because Sitecore does not expand variables in element bodies, only attributes.
will not expand. You can see expansion in the showconfig.aspx page - the variable is applied at the config provider level.
Unicorn gets it because you're injecting it on an attribute as opposed to a body.
Unfortunately without altering the configuration schema significantly and breaking backwards compatibility there is little I can do about this. It's Sitecore's rules that are being followed.
Now that said, since multiple configs are supported it would be fairly easy to alter the way the default config is registered and/or register your own config - which can expand whatever variables you like since at that point the registration is in C#.