0

Hi I don't think this is possible but I have a value that needs to be used in multiple xml Config files for a Sitecore site. The problem is that the client only wants to update the value in one place.

for example if I have a file with a node with a value of

<settingexample name="ExampleGroup"/>

can I replace ExampleGroup with something that might link it to a settings xml file with the following setting

<setting name="ExampleProject.UserDomain" value="ExampleGroup"/>

That way all the xml nodes will match if I change it in a single place.

CodeNotFound
  • 22,153
  • 10
  • 68
  • 69
Kisbys
  • 413
  • 1
  • 3
  • 12
  • You could move the common config settings in an external file that you include in this one. See http://stackoverflow.com/questions/480538/use-xml-includes-or-config-references-in-app-config-to-include-other-config-file and http://stackoverflow.com/questions/487991/is-there-any-way-for-an-app-config-file-to-reference-another-full-config-file. – Marius Bancila Feb 10 '16 at 22:37
  • 1
    Your question isn't clear. If you have a single value, why is it specified in multiple files? Why not just specify the value once? Can you be more specific in what you trying to achieve with clearer examples. – jammykam Feb 10 '16 at 22:48

1 Answers1

3

You could use <sc.variable> like Sitecore does for the data folder.

Declare the variable:

<sc.variable name="dataFolder" value="/data" />

And then use it:

<setting name="DebugFolder" value="$(dataFolder)/debug" />
Ben Golden
  • 1,580
  • 9
  • 16