Log in

View Full Version : Merge rules



GrimmSpector
February 26th, 2016, 04:41
Can someone explain to me the functionality and values of the merge rule tag? I can't seem to find much reference to it in the refdocs.

Moon Wizard
February 26th, 2016, 23:01
The "mergerule" attribute is defined here:
https://www.fantasygrounds.com/modguide/templates.xcp

Basically, it specifies that how template tags should be treated when a control implementing a template specifies the same tags. (i.e. merge, add, replace, resetandadd)

The "merge" attribute was added later, and allows a developer to specify in the implementing control definition how template tags should be treated. It's basically specifying the merge behavior in the child, instead of the parent. It uses the same tags, though a "delete" option is also supported.

Regards,
JPG

GrimmSpector
February 27th, 2016, 02:39
Heh I searched almost every other page for it, thank you.

I assume resetandadd resets to the the top level and then drops the most recent part on the end of it? Rest seems pretty standard.

Thanks, very informative.

Moon Wizard
February 27th, 2016, 03:27
"resetandadd" will clear any tags with the same name, then go into append mode.

Both "add" and "resetandadd" are for working with multiple XML tags with the same name. I'm not in front of machine to give an example, but I believe childframe tag for list controls might qualify.

Cheers,
JPG

GrimmSpector
February 27th, 2016, 04:28
Ah gotcha, ok thank you!