DXA Default Template Building Blocks – Updating

December 3rd, 2017 | Posted by Robert Curlette in DXA

In this article I’ll discuss the process of downloading and compiling the Default DXA TBBs, and then we can add our new TBB to the default DXA project.  You might want to do this so you can add another TBB into the DXA project, or to modify one of the existing ones.  However, the DXA team would like to get your updates as a Pull Request so they can make the existing ones even better.

Modifying the Default DXA TBBs

1. Download the sources (with the correct version selected) from here: https://github.com/sdl/dxa-content-management

2. Open the solution and look at the Properties, then Build Events. There is a post-build event with the following:
“C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe” ^
/out:Sdl.Web.Tridion.Templates.merged.dll ^
/targetplatform:v4 ^
/lib:C:\_references\cm-8.1 ^
Sdl.Web.Tridion.Templates.dll DD4T.ContentModel.Contracts.dll DD4T.ContentModel.dll DD4T.Serialization.dll DD4T.Templates.Base.dll Newtonsoft.Json.dll /log

3. Check if you have ILMerge.exe in the folder C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe. If not, then download here: https://www.microsoft.com/en-us/download/details.aspx?id=17630

4. Copy the DLLs from the Tridion/bin/client folder to a folder on your local drive. I prefer to keep the references as part of the project. For example, I use: C:\RC\dxa-tbbs-1.7\dxa-content-management-release-1.7\references

All DLLs are required, even the ECL ones, and they’re all listed on the README here: https://github.com/sdl/dxa-content-management. If you don’t have ECL installed, you’ll need to install it at least on your Dev server to get the DLLs. You can use the Add/Remove Programs and ‘Change’ option to add the feature. Restart required, because the GUI will complain after you install the ECL without a restart.  Also, The DLLs after the path are expected to be found in the /bin/debug folder of the project.

5. Build

Potential errors:
1. Error code 3 – This means Visual Studio cannot find ILMerge.exe
2. Error code 1 – It cannot find the DLLs folder specified in the post-build script

Tips:
– Use the /log switch in the post-build command to write the output to the ‘Output’ window for easier debugging

Happy hacking!

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

Leave a Reply

Your email address will not be published. Required fields are marked *