Could anyone shed some light on the reasoning behind the Local Datasource mechanism where it will use the local datasource path in the layout xml instead of the datasource item ID? e.g. local:/Data/test instead of local:{guid} I don't see any benefit to this, as it bypasses the link manager which has other implications around renaming and functionality that relies on the link manager such as SPE scripts / content translation modules.


The local:/Data/test option means you can duplicate pages, use branch templates, create snippets etc.... without having to have any extra complicated code to reassign the datasource references after the duplication. Because of the local part - it just works and finds the datasource item that is local to the page always.

There would be little point to the local part if you are using a guid - the guid is always the same. Using a guid would mean that SXA would now have to hook into any code used for duplicating a page item and update the datasource item references. Also the code used to create a local copy of a snippet would have to update the references, as it would do for all the times branch templates are used. And they are used heavily in an SXA site.

The local:<path> option means all this works nicely without that extra code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.