You might run into a situation where you need to have a list template that has a lookup field in it and you want it to look up by list name, not GUID. I my case I have to replicate 3 lists to all child sites for a custom control. Well after fighting with the xml and not finding any real solutions, I stumbled upon a hidden jem barried deep in the bowels of the internet. An anonymus comment on an old blog post hinted that you can replace the GUID in the List property with “Lists/[ListName]“. Well what do you know, it works.

The important portion of your XML line should look like:

<Field Type="Lookup" List="Lists/SiteMenuSections"/>

This will also work with a List Template .stp manifest file. You can simply download the stp file, extract the manifest.xml and modify it. Then use makecab and a properly formated ddf file to create the new stp file. Upload and you’re done.

Hopefully this will save someone a headache and some time.

About these ads