Ok, now this is suprising, and I ask myself (and you) if this is a bug:
It seems paramater key names must be unique throughout the whole site cause the scope of parameter keys is somewhat “blurry”? Or is this an official requirement I missed in the docs? A simple example:
In Cornerstone create a new Component page and create a headline with a simple parameter JSON like this:
{
"headline" : "My headline text"
}
Then connect the parameter as intended to the Content by using
{{dc:param:headline}}
In the Element Manager check the export, so that we can use that headline in a different component. Nothing special so far. The usual component creation process.
But now in Cornerstone create a second component page. Create a section and add the exported headline from above. Now open the Element Manager of the section, click Edit Parameters and again add the following JSON:
{
"headline" : "My Section headline"
}
Attention: same key headline as in the element above.
Now open the headline element in that section and again use the following parameter as above:
{{dc:param:headline}}
Now after a Save and Reload I get the infamous “The preview could not load …” error.
But if I rename the last parameter key to something else (i.e. headline2) everything works.
So it seems the parameter keys do collide here.
If this behaviour is as intended, it is crucial to always use unique parameter key names throughout the whole site to avoid such a collision. I hope, that this is not the case, cause on a very large projects with lots of components this will get hard to fullfil … well maybe with a good structured naming convention like this:
{
"componentNameMyHeadline" : "My Section headline"
}
But if you rename a component page the name does not fit anymore (but at least it still works).