One thing that is a barrier to reuse of Template Building Blocks across different projects is the problem of having to upload the Parameters Schemas for the Template Building Blocks each time.
This can be solved by embedding the Schemas as resources in the Template Building Block DLL. The TcmUploadAssembly executable will automatically create the Parameter Schema for you.
The disadvantage of this approach is that your schemas will end up in the same folder as your TBBs and if you then make changes to the Schema in SDL Tridion you need to remember to update the XSD file in your project with your changes.
However, this makes for much easier installation of a set of Template Building Blocks so can only help reuse.
To achieve this:
- Add your schemas as XSDs to your Visual Studio project in a folder called "Resources"
- Open the properties of the XSD and set the Build Action to "Embedded Resource"
- Add the schema to your Template Building Blocks like so:
- Run the TcmTemplateUploadAssembly tool
- You will now see your schema in the same folder as your TBBs
I thought this was a neat time saving trick when I noticed it in the DD4T Templates project and it would be good to share it!
Please note I have only tried this in SDL Tridion 2011 SP1.