uSync - Do not output StartNodeId in Datatypes
# help-with-umbraco
s
I have a custom event handler that after uSync runs remaps the StartNodeId based on a folder name (creating the media folder if it doesn't exist). This is to get around different environments having different start node IDs and constantly overwriting each other and breaking the picker for the editors. Works great - but source control is still tracking the change and is driving us all nuts. Is there a way to configure uSync to output data types but not output this value. I've had a look at the settings but can't see anything that fits the bill.
k
The dataTypeSerializers package should help here. https://www.nuget.org/packages/uSync.Community.DataTypeSerializers#readme-body-tab it turns the Ids inside datatypes into paths on export and paths back to ids on import, so if the content / media nodes are not synced it maps them for you.
s
So if the folder path doesn't exist on import does it create it? Or do I need to keep my bit of code to do this bit?
k
no it won't create any content, (it wouldn't know what type etc) - but if it does exist it will find it and use the id that is there as the one for the picker.
if you look at the files it basically replaces the id (e.g 1053) with the path (eg. '/home/about-us/contact' and on the import it does it the other way.
s
Cool I think that will do what I want then and I keep my code too 🙂 Thank Kevin.
2 Views