Hedgehog Development originally developed Sitecore TDS as an internal project to help our own development teams build Sitecore implementations. Sitecore TDS was developed for Sitecore developers, by Sitecore developers. The guidelines documented in this manual are the best practices we have built around using Sitecore TDS as a development platform for many Sitecore implementations. We recognize that not all development projects are organized the same way, and Sitecore TDS was designed to allow as many different ways of developing Sitecore sites as possible.
The primary goal of Sitecore TDS was to allow developers to manage their Sitecore schema (Templates, Layouts, Sublayouts, Taxonomy and meta-data items) the same way they manage source code. The Software development field has, over the years, built many exceptional tools and practices for managing and deploying source code, but Sitecore developers were not able to leverage things like Source Control, automated builds and automated deployments for their Sitecore items.
When developing a website, it makes sense for developers to build the implementation on a local IIS instance and commit the result to source control. Since Sitecore is a platform built on IIS, the practice of developing on a local IIS instance is a given.
Before Sitecore TDS was developed, Sitecores’ recommended development environment was a local IIS and a shared database. This worked reasonably well, but there was always a chance that developers would introduce conflicting changes to the database, and resolving these conflicts could cause delays in the development process.
One of the reasons Hedgehog Development created Sitecore TDS was to easily allow developers to build a Sitecore implementation in an isolated development environment. This would mean each developer would have their own instance of the Sitecore databases on their local machine and could work without fear of causing problems for other developers on the team. Sitecore TDS allows developers to bring their changes into a Visual Studio project and, much like source code, the changes made to Sitecore can be committed to source control.
One of the practices we use at Hedgehog Development is to locate all source files and projects outside of the Sitecore web root. Sitecore TDS has a built in process that allows the compiled solution to be copied to the target Sitecore website at build time. This allows the developer to easily keep track of items in their project. This arrangement is also advantageous when using file system based source control systems like GIT. There is no longer a need to exclude Sitecore components from Source Control, since the source control system does not see them in the file system. This arrangement also closely resembles the deployment process and configuration used in production environments, which leads to more stable releases.
Sitecore TDS, much like other Visual Studio projects, allows developers to create both simple and very complex Visual Studio solutions. Since solutions tend to grow in both size and complexity over time, it makes sense to start with a very simple and flat file structure. As the solution grows, keeping the solution files as flat as possible makes it easier to work with, build and deploy.
A typical simple Sitecore solution consists of a Web Project, one or more Class Libraries and one or two Sitecore TDS projects. There are other possible project types that may be added to the solution as needed. As a starting point, only these three will be covered.
Sample Visual Studio Project | Solution File Structure. |
---|---|
An example of a simple Sitecore solution. | The folder structure for this solution. The file structure closely resembles the solution in Visual Studio. |
In the example above, there is a \Lib folder in the file system. This contains any reference DLL’s needed to build the project. By keeping all resources needed for the project under a single folder, the development team can easily leverage advanced source control features like branching, merging and labeling. Additionally, this structure lends itself to setting up automated builds.
The Sitecore TDS project property pages are used to connect the Sitecore TDS project to a Sitecore instance and to control how the Sitecore TDS project interacts with other projects in the solution during the build.
Contains settings that are common to all project configurations.
Used to turn on and control Sitecore TDS Code Generation.
Please see the code generation section below for more information on the Code Generation property page.
The Multi-Project properties page allow you to setup dependencies between projects within the same solution.
The Base Template Reference section can be used to tell a Sitecore TDS project where it should look for base templates when generating code for templates in the current project:
For example, imagine the there is the following project setup with templates T1 and T2. Template T2 inherits template T1 but they are in different projects.
When Sitecore TDS performs code generation we want templates generated by the TDSDemo.Layouts project to be used by the TdsDemo.Templates project.
The generated class for TdsDemo.Layouts will look like this:
namespace TdsDemo.Layouts.sitecore.templates.TDS.Set1
{
public partial interface IT1
{
string F1 { get; set; }
}
}
And the generated glasses for TdsDemo.Templates will be:
namespace TdsDemo.Templates.sitecore.templates.TDS.Set2
{
public partial interface IT2 :
global::TdsDemo.Layouts.sitecore.templates.TDS.Set1.IT1
{
string F2 { get; set; }
}
}
Notice that the second code generated file references the classes generated by the first.
If the two generated files are in different projects then a reference to the project with the first generated file will need to be added to the second project.
The referencing project must know how to generate the namespaces required by the referenced project. For example if the referenced and referencing project use different methods of generating namespaces then the referencing project may not be able to find the classes in the referenced project.
Adding a code generation reference file allows the code generation templates to reference Sitecore templates in other solutions. A code generation reference file is created by right-clicking on the TDS project and selecting “Export Code Gen Reference File”. This will allow the user to select a location and filename for the file.
To add a code generation reference file to a project, select “Add File” and use the file browser dialog to locate the file.
Once the file is selected, the path is converted to a relative path if possible and added to the list.
To remove a file, select it in the Code Gen Reference File list and click the “Remove” button.
The Package Bundling section can be used to tell a Sitecore TDS to pull in items from another project when creating an Update Package. When Sitecore TDS builds the current project it will automatically add any items in the referenced projects to the update package.
If the referencing and referenced project both contain the same item, the item in the referencing project is used.
Package bundling only works when the Update Package has been configured, see the Update Package section below.
Many Sitecore projects include Modules distributed as Sitecore Packages. These packages are .zip files and contain compiled code, assets and Sitecore items. In many cases, a Sitecore solution depends on a list of packages being installed on the server. If the packages aren’t deployed, there is a good chance the Sitecore solution would fail. Sitecore TDS Package Validation ensures the package is installed and will fail the deployment if the package isn’t present.
The Selected Package list is the list of Sitecore packages that are required for the solution. The packages must be reachable at build time. Sitecore TDS only checks if the selected Sitecore packages are installed when solution is being deployed. These checks are not performed when an update package is deployed.
If the selected Sitecore packages are not present on the server, the build fails with an error message.
Install Package Configurations shows the available configurations in the Sitecore TDS project. If the configuration is selected in the list, Sitecore TDS will install the package on the server if it is missing instead of failing the build. Please note, package post steps will not run when this package is installed. The only items and files will be deployed.
Assembly Validation causes TDS to check the specified assembly versions and terminate the build/deployment if the assemblies being deployed are different than the version in the target folder. This feature is designed to prevent different versions of assemblies from being deployed over the assemblies provided with the installed
Sitecore TDS now supports the Sitecore Assembly Version nuget packages. These packages are named Sitecore.Assemblies.*, and contain a list of all assemblies used by the released version of Sitecore and the expected version number of each assembly. These are a great resource for ensuring that all assemblies being deployed to Sitecore match the version Sitecore expects.
Sitecore TDS versions 6.0.0.14 and up are aware of these Nuget packages and will automatically check the versions at build time if the package is installed in the TDS project. To take advantage of the new packages check Enable Assembly Validation and add the Sitecore.Assemblies.Platform Nuget package for your version of Sitecore to your TDS project. If any assemblies being deployed to Sitecore are different than the expected version, TDS will flag the assemblies with the incorrect version as build errors.
Contains settings used to connect Sitecore TDS to a Sitecore instance. The settings on this page are different for each project configuration, allowing Sitecore TDS to easily work with multiple Sitecore instances.
Sitecore Deploy Folder should point at the location that the Sitecore Web URL is running from. If you select a folder that Sitecore TDS does not think it is a Sitecore web root a warning symbol next the Sitecore Deploy Folder:
Once you have set the Sitecore Web URL, Sitecore Deploy Folder and checked the Install Sitecore Connector field you can test your settings using the Test button:
Clicking the Test button will bring up a second prompt that will automatically check that you have configured you Sitecore TDS project correctly:
Contains the settings needed to build Sitecore Update Packages.
Contains the settings needed to build WebDeploy packages with Sitecore TDS. These packages can contain both code and items. When the package is installed on a Sitecore server, the package will automatically deploy any items in the package.
For more information on deploying packages in Azure and to stand alone Sitecore servers, please see Using WebDeploy packages.
Contains the settings needed to build ‘Items as Resources’ files.
The Sitecore TDS Deploy property page allows the developer to select actions to perform at deployment time. These actions will be executed for Sitecore TDS Deployments and Package Installation as Post Deploy Steps.
The Deploy property page comes with a few built in functions. These are designed to solve some of the most common problems encountered with package deployments. The built in deploy functions are:
Each post deployment action has its own parameter value.
Sitecore TDS allows developers to create and use NuGet packages the same way they do with other projects. Packages can be created from any Sitecore TDS project by enabling NuGet package generation in the NuGet Package property tab.
The created packages can be uploaded to any NuGet package repository and installed into other Sitecore TDS projects by using the “Manage NuGet Packages…” right click menu on the Sitecore TDS project in the solution explorer.
The NuGet package generation property page allows the developer to set all NuGet package generation options:
The Validations tab allows you turn on checks that Sitecore TDS can perform on the project when it is built.
Sitecore TDS supports the following validations:
The Project Report property page enables generation of a project report at build time. This report will contain information about each item in the project. This is useful for documenting the items in a solution.
Allows the Sitecore TDS project to be configured to automatically copy files into the build folder before deploying the built project. This is useful for managing environment specific configuration files. The File Replacement step runs after the web project has been built and copied, but before package generation and/or deployment to Sitecore.
To delete an item from the replacement list, select the row using the row selector on the left and press the <delete> button.
A Sitecore TDS project contains many different types of Sitecore items. These items all serve different purposes in the Sitecore implementation, and it is likely they need to be treated differently at deployment time. Developers can easily manage how each Sitecore item in the Sitecore TDS project is deployed through Deployment Properties.
Setting deployment properties can be time consuming. Sitecore TDS was designed to help developers with this process by intelligently choosing default values for deployment properties. If an item is added under an existing item, Sitecore TDS will set the new items deployment properties to have the same values as the parent item.
Deployment properties are managed for an individual item in the Visual Studio property window. The property window is opened by right-clicking on an item and selecting properties. It may also be opened by clicking on an item and pressing the F4 key.
How items are removed from the project by the Child Item Synchronization settings are controlled by a project configuration setting on the Build property tab.
The Recursive Deploy Action setting determines the action Sitecore TDS will take when an item should be removed. The default setting is to take no action, which effectively disables this feature. The recommended setting is "Move the item to the Sitecore Recycle Bin", which allows developers to easily recover from problems with these settings.
It is recommended that the Sitecore databases are backed up before beginning any deployment regardless of the Recursive Deploy Action setting.
The Sitecore TDS Options Window allows you to access global settings for Sitecore TDS, these settings will apply across all Visual Studio instances.
To access the Sitecore TDS Option Window click on the Tools menu then Options. TDS Options will be visible in the left hand list:
The following options are available in the General Options screen:
The Sync Window screen allows you to set a list of fields that should be ignored when comparing items. Items with differences only in these fields will not show up in the Sync Window as being different.
Checking the Hide fields with the same value in the Sync Results will stop fields with identical values from being displayed in the Sync Window, this can make it easier to compare items.
The Sync Window Languages screen allows you to manage a list of languages that should be ignored when comparing item. Items with differences on languages will not should up in the Sync Window as being different.
This behaves very similar to the ignore fields window.
The Deployment Property Manager allows developers to view and update deployment properties on many items at one time. This is a much more convenient way of managing deployment properties.
The Deployment Property Manager can be opened by right-clicking on the Sitecore TDS project or any Sitecore item in the Solution Explorer and choosing “Deployment Property Manager”. This opens a window showing the Exclude Items From, Child Item Synchronization and Item Deployment properties for all the Sitecore items under the item selected in the Solution Explorer. Initially, the Deployment property manager only shows Sitecore items with deployment properties that are different than their parents properties. Expanding the items in the tree will show all Sitecore items under the expanded item. Collapsing the item will hide any items that have the same properties as their parents.
For an explanation of the various options for each of the properties, please see the descriptions in the Visual Studio Property Window section
The Set Descendant Properties button will change the deployment properties of all Sitecore items under the selected item to have the same deployment properties.
The Inherit Parent Properties button will set the current item to have the same deployment properties as its parent.
Clicking either of the buttons will potentially change the visibility of items in the tree view because their properties are being changed.
Sitecore TDS helps developers to manage their Sitecore items. To do this, the items the development team wants to manage must be brought into the Sitecore TDS project. This can be done with the Get Sitecore Items dialog and the Sync Window (see below).
The Get Sitecore Items dialog can be opened by right clicking on the Sitecore TDS project or a Sitecore item in the Solution Explorer window. The dialog will show the Sitecore content tree. Developers can browse the tree and select items to bring into their project by using the check boxes to the left of the Sitecore item.
The Get Sitecore Items dialog implements a number of features to make it easier to bring items into a project.
When an item has been selected using the right-click menu to select all child items, Sitecore TDS will automatically set the Child Item Synchronization setting in the items to KeepAllChildrenSynchronized.
After selecting the items from the Sitecore content tree, the developer can click the “Get Items” button and the selected items will be added to the project.
Correctly choosing the Sitecore items to bring into a project is very important. Adding the wrong items to a Sitecore TDS project will make the project difficult to maintain and deploy. Please review the section Choosing which items to bring into a Sitecore TDS project for guidelines on choosing which items to add to Sitecore TDS.
As a Sitecore implementation grows, developers will add or make changes to items in their Sitecore development environment. Sitecore TDS offers developers a way to track these changes and bring them into their Sitecore TDS project. This is done by using the Sync Window.
To open the Sync Window, right click on the Sitecore TDS project or any item in the Solution Explorer and select Sync with Sitecore, the sync window will then begin comparing the item and its descendants in the Sitecore TDS project to the Sitecore instance for the current project configuration.
When the compare process is complete, the sync window will show the items that are different between the project and Sitecore. You can compare just the select item by clicking Sync this Item instead of Sync with Sitecore.
The Sync Window allows developers to inspect the differences between Sitecore and the Sitecore TDS project and determine what to do about those changes. The developer may select individual items, or multi-select items using standard windows selection keys (<shift> and <ctrl>) and choose an operation to perform on the items. If an item is collapsed and selected, it will be assumed by the Sync Window that all items under the item are selected as well. Once the developer has selected the operation to perform on each item, they can click on “Do Updates” to perform the actions.
The Sync Window uses the **Child Item Synchronization** setting to determine if it should look for new items under an existing Sitecore item. This feature of Sitecore TDS is an optimization to prevent large content trees that are not part of the Sitecore TDS project from being scanned during a sync operation.
If you are comparing fields with large amounts of data the Sync screen will display a grey button next to the field that will allow you to see the full field contents:
Click the icon will open another dialog that shows the full contents of the field:
The Sync Window has the following keyboard shortcuts when you have selected an item:
Key Combination | Action |
---|---|
Shift + left arrow | Update project |
Shift + right arrow | Update Sitecore |
Shift + up arrow | Merge items |
The merge window allows the developer to pick individual fields from a Sitecore item and move them into the Sitecore TDS project. This is useful for resolving changes multiple developers have made to an item.
The developer can pick which field value they wish to use by clicking on the edit icon and choosing the value in the field merge window.
There are three types of field merge windows. They all look very similar, but perform different functions.
The Xml or presentation field merge window allows the user to merge individual Xml elements in an Xml field. This is very useful for merging presentation details or tracking fields.
All guid values in the Xml are checked to see if they refer to known Sitecore items and their values are replaced with the Sitecore path. This only happens at display time and the guid values are preserved in the field
The developer can use the arrow keys to copy an element from the project to Sitecore, or use the trashcan to remove the element from the xml
The Multi-list merge window shows the differences between multi-list items in the project and in sitecore and allows users to move the items between the two. In a multi-list, items are stored as Guids, but the merge window will show the items as Sitecore paths to make merging the values easier.
The developer can use the arrow keys to copy an element from the project to Sitecore, or use the trashcan to remove the element from the xml
The text field merge window is used for all other field values. The user can edit either side in a simple text editor.
When the developer has completed their selection, they can click OK to accept the changes. Selecting “Skip Merge” will not perform the merge action. The “Cancel Sync” button will abort the sync process. This will skip any updates that have not been performed yet.
The Merge Window has the following keyboard shortcuts when you have selected a field:
Key Combination | Action |
---|---|
Shift + left arrow | Update project |
Shift + right arrow | Update Sitecore |
Due to the nature of Sitecore items, renaming a Sitecore item will cause cascading changes to all items below the renamed item. While Sitecore TDS handles these changes correctly, the source control system used by the development team may have issues with the changes made to the project. At Hedgehog Development, we recommend that renaming Sitecore items be performed separately from other sync operations. If possible, each rename operation should be committed to source control individually before performing any additional sync steps. Following these guidelines should reduce the number of problems encountered while renaming items.
Moving Sitecore items is very similar to renaming Sitecore items, and the guidelines for renaming Sitecore items also applies to moving items. When moving items, there is an additional requirement that the developer must sync from a folder that is an ancestor of the location where the moved item originated and the location where the moved item currently resides. This will ensure that the move operation on the item is correctly recognized.
If your solution has many TDS projects in it, syncing each project individually could be vary time consuming. To sync all projects at once, right click on the solution and select the Team Development for Sitecore -> Sync all projects with Sitecore menu.
This will open the sync window, but all projects in the solution will be checked for differences.
The Sync Using History Window allows the developer to view their changes based on the content of the Sitecore History table. This sync window works much like the original sync window; the major upgrade of the Sync Using History Window is focused around its performance over the original sync window. Since the Sync Using History Window is only viewing items in the history table, it can find changes made by the developer much more rapidly.
The Sync Using History Window will intelligently filter the content of the history table before presenting them to the user. The filter criteria for showing an item in the Sync Using History Window is based on the following:
If an item, in the history table, meets these criteria, then its latest history entry is shown in the top portion of the dialog.
Here are the new buttons in the Sync Using History Window (see above image):
Please Note: The Sync Using History Window will only find changes based on the content of the history table. This means that Sitecore operations that do not make an entry in the history table, such as Serialization, will not be included in the window.
If your solution contains many Sitecore TDS projects, ensuring all projects are up to date can be done using a single Sync operation. Sync All Projects Using History looks at all changes in Sitecore and checks them against all Sitecore TDS projects in the solution using the same Sync rules as the Sync Using History function.
To start syncing all projects, right-click on the solution in the Solution Explorer and choose “Sync all Sitecore TDS Projects using History”
Sitecore TDS will open a sync using history window with an additional “Project” column, indicating which project the changes in Sitecore belong to.
All functions of the Sync All Projects Using History window work exactly the same as the Sync Using History window. For an explanation of how to use the window, please see above.
The Quick Push Items function is designed to quickly deploy Sitecore items from the project into Sitecore. No code is pushed, only items. The items are pushed in dependency order to ensure that templates are pushed before content and/or other templates that depend on them.
Quick push is accessed from the right-click menu on the project:
This will open the quick push dialog and immediately start pushing items to Sitecore:
If you have a large number of TDS projects, you can use the Quick push all TDS Projects menu found by right clicking the solution in the solution explorer and opening Team Development for Sitecore -> Quick push all TDS Projects.
The Sync Sitecore Roles window allows the developer to compare all roles in Sitecore with the roles in the Sitecore TDS project, much the same way Sitecore items are managed. Before using the Sync Sitecore Roles feature, it must be enabled for the project.
Right clicking on the “Sitecore Roles” folder will open a menu with an option called “Sync Sitecore Roles”. Choosing this option will open the Sync Sitecore Roles window.
The Sync Sitecore Roles window operates much like the other Sitecore sync windows. Since there are far fewer roles in Sitecore than items, the Sync Sitecore Roles window is much simpler.
After selecting the desired operations, clicking the “Do Updates” button performs the actions on the roles.
Roles in the Sitecore TDS project can be deployed using Sitecore TDS, or compiled into an update package for deployment on a remote server.
Sitecore TDS adds a number of options to Visual studio outside the TDS project. There is a Team Development for Sitecore solution right-click menu and a TDS Toolbar.
The Sitecore TDS solution right click menu allows the developer access to TDS features that effect all projects in the solution. To open the TDS Class Solution Right click menu, right click on the solution and click on Team Development for Sitecore on the solution menu. This will open a fly-out menu with the Sitecore TDS solution level functions:
The Sitecore TDS toolbar allows the developer to quickly access the same functions as the TDS Solution right-click menu without opening the right-click menu. The toolbar is hidden by default, but can be opened by right-clicking on the toolbar area of Visual Studio and checking “TDS Toolbar”
The functions of the buttons on the toolbar are as follows:
The Sitecore Item Merge tool is a stand alone tool used to resolve merge conflicts in .item files during a source control merge/check-in. During installation, Sitecore TDS automatically configures the Item Merge Tool for TFS. Configuring the Sitecore Item Merge tool for other Source Control providers will be covered below.
When your source control detects a conflict, it will require user intervention to merge the files. Although, Sitecore item files are plain text files, they are not as simple as text files. Care needs to be taken to properly manage field ID’s, versions and languages during the merge. This requires a specialized tool to do the process quickly and efficiently.
This screen shot shows a number of possible merge scenarios that may occur:
When resolving a merge, the user can choose to accept a change, reject a change or choose the value from one side or the other by checking the check boxes and/or radio buttons in the top portion of the merge tool. You can see the result of your choices in the lower portion.
The merge tool offers a few shortcut functions from a tool bar. The tool bar buttons perform the following tasks:
Move to the previous difference | |
Move to the next difference | |
Move to the previous conflict | |
Move to the next conflict | |
Select all non-conflict changes | |
Accept all changes |
Sitecore TDS automatically configures the Sitecore Item Merge to run for .item files inside of TFS. However, it needs to be configured for other source control providers.
The Sitecore Item Merge tool can be run from the command prompt. It accepts seven parameters from source control, which represent the four files that are part of the three-way merge, and optionally, the labels for each of the three sections of the window. The arguments for the Sitecore Item Merge are shown below in the order they are expected.
By default, Git only allows a single file merge tool. Fortunately, Git allows the developer to easily extend the merge functionality and allow us to use different merge tools for different file types. Please see the article: merge-wrapper (https://gist.github.com/elsevers/11349227) for more information on extending Git to use multiple merge tools.
The following code block is sample code modified from the above to provide Sitecore item merge capabilities in Git. Copy this script into a text editor, and save it without any file extension to your $HOME directory as ‘merge-wrapper-script’ (i.e C:\Users\myUserName\merge-wrapper-script
).
#!/bin/bash
# Wrapper script for git mergetool
# This requires the .gitconfig file to have:
# - mergetool entry for "TDSMerge";
# - mergetool entry for "kdiff3";
# These merge tool entries must both specify the
# cmd field. The command to call this script:
# [mergetool "merge_wrapper"]
# cmd = $HOME/merge-wrapper \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
# Locate this script in your $HOME
BASE=$1
LOCAL=$2
REMOTE=$3
MERGED=$4
SCITEM="\.item"
if echo "$BASE" | grep -q "$SCITEM"; then
echo "Using merge tool for sitecore item file";
CMD=$(git config mergetool.TDSMerge.cmd)
eval $CMD
else
#checking for additional special merge tool cases
#Finally, the default case:
echo "Using default merge tool";
CMD=$(git config mergetool.kdiff3.cmd)
eval $CMD
fi
[mergetool "kdiff3"]
cmd = \"C:/Program Files (x86)/KDiff3/kdiff3.exe\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"
The above code will detect the extension of the file being merged. For .item files it will run a mergetool entry called ‘TDSMerge’ from the .gitconfig file.
For all other files, it will run a mergetool entry called ‘kdiff3’ from the .gitconfig file. You can change ‘kdiff3’ to any other mergetool entry of your choice that you have installed, for example ‘winmerge’ or ‘TortoiseMerge’.
Note: .gitconfig files may exist in different locations for a developer’s machine. Typically, a global .gitconfig file (used for all of your git repositories) can be found at $HOME\.gitconfig
(i.e C:\Users\myUserName\.gitconfig
).
Now three modifications will be needed for the .gitconfig file:
First, change which mergetool entry Git will use for merges to ‘merge_wrapper’.
[merge]
# tool = kdiff3 Commented out because we're switching over from kdiff to our merge wrapper script
tool = merge_wrapper
Now create the ‘merge_wrapper’ entry which will call the merge-wrapper-script.
[mergetool "merge_wrapper"]
cmd = $HOME/merge-wrapper-script \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
Finally, create a TDSMerge entry, which is the entry that will be called by the script for any .item file merges.
[mergetool "TDSMerge"]
cmd = \"C:/Program Files (x86)/Hedgehog Development/Team Development for Sitecore (VS2013)/SitecoreItemMerge.exe\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
Note: Update the path of the SitecoreItemMerge.exe to the installation folder of Sitecore TDS for whichever Visual Studio version it is installed for. In this case, we’re pointing to the Sitecore TDS installation folder for Visual Studio 2013.
Some Git tools don’t allow you to configure multiple merge tools based on the file extension. If you are using a tool like this, we have provided a simple merge tool wrapper application that can be configured to allow you to use multiple merge tools. This will effectively produce the same result as the merge-wrapper script above.
To setup the merge tool chooser, you will need to change your .gitconfig to point to a new ‘merge_chooser’ mergetool entry.
[merge]
# tool = kdiff3
tool = merge_chooser
Also add the ‘merge_chooser’ entry as follows
[mergetool "merge_chooser"]
cmd = \"C:/Program Files (x86)/Hedgehog Development/Team Development for Sitecore (VS2013)/MergeToolChooser.exe\" \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
Note: Update the path of the MergeToolChooser.exe to the installation folder of Sitecore TDS for whichever Visual Studio version it is installed for. In this case, we’re pointing to the Sitecore TDS installation folder for Visual Studio 2013.
The MergeToolChooser.exe application reads it’s configuration from the MergeToolChooserConfig.xml file located in the same directory. By default it specifies that SitecoreItemMerge.exe is the merge file for .item files and KDiff3 is the default merge tool for everything else.
<?xml version="1.0" encoding="utf-8" ?>
<MergeToolChooserConfig>
<!-- TDS Item Merge Tool -->
<MergeTool Extension=".item" Cmd=".\SitecoreItemMerge.exe" Parameters=""$1" "$2" "$3" "$4""/>
<!-- Default entry -->
<MergeTool Cmd="C:\Program Files (x86)\KDiff3\kdiff3.exe" Parameters=""$1" "$2" "$3" -o "$4""/>
</MergeToolChooserConfig>
This file can be altered to allow any merge tool(s) the developer wants to use. The parameters are specified in the Parameter attribute by using $1, $2, $3, etc. Where $1 represents the first parameter passed to the merge tool, $2 represents the second, and so on. The Extension attribute specifies the file extension to use for the specified merge tool. The Cmd attribute specifies the full path to the merge tool.
The merge tool is matched using the order that <MergeTool> elements are specified in the file and is based on the string specified in the Extension attribute. If no Extension attribute is specified, the merge tool is considered the default merge tool, therefore ensure it is the final entry in the list.
A global configuration file can be added to a solution to control project properties across multiple Sitecore TDS projects.
To add a Global config right click on the solution in the Solution Explorer and click Add Global Sitecore TDS Config File:
This will add the Solution Folder .tds containing the file TdsGlobal.config. Opening the file will show a set of commented out settings that can be controlled at a global level. Uncommenting a property allows the developer to set a value that will be used by all the Sitecore TDS projects, for example setting a PackageAuthor for all packages generated by all Sitecore TDS projects in the solution:
<!-- Packaging properties -->
<PackageAuthor>TDS Developer</PackageAuthor>
<!--
<PackagePublisher></PackagePublisher>
<PackageVersion></PackageVersion>
<PackageReadme></PackageReadme>
<SitecoreAssemblyPath></SitecoreAssemblyPath>
<GeneratePackage></GeneratePackage>
<SeperateFilesAndItems></SeperateFilesAndItems>
<AddDateTimeToPackageName></AddDateTimeToPackageName>
-->
When a change is made to the TdsGlobal.config Visual Studio will prompt to reload all the TDS Projects, click Yes otherwise you may need to manually reload projects to see global configuration changes.
Opening the properties page for a project will now show that the Package Author value is being pulled from the global config:
Values pulled from the global config can not be altered on the project page and therefore the control is disabled. The property will also display a globe to the right of the property to indicate it is a global value.
In TdsGlobal.config and TdsGlobal.config.user, please note that for the unconditional PropertyGroup section, only the Global Properties specified under the section can be used, which are SerializationFormat and CompactSitecoreItemsInProjectFile. Non-global properties should not be added in this section.
No custom properties should be added in TdsGlobal.config and TdsGlobal.config.user under any PropertyGroup section
Sitecore Rocks is a Visual Studio add-in that offers many great features designed to improve developer productivity when working with Sitecore. The features of Rocks that concern Sitecore TDS are the features that allow developers to perform some of the functions found in the Sitecore desktop without leaving the Visual Studio. Sitecore TDS takes advantage of the Sitecore Rocks plug-in framework to create a connectivity layer between Sitecore TDS and Rocks.
When a developer adds, updates or removes an item or template in Rocks, Sitecore TDS is notified and automatically pulls those changes into the Sitecore TDS project. In addition, when Rocks is connected to Sitecore TDS, double clicking on a Sitecore item in the Solution Explorer will open the item in the Rocks item/template editor.
There are two things needed to make Sitecore TDS react to changes made in Rocks.
You can include Sitecore items directly from Rocks, right clicking on an item in Rocks you will be able to access the Sitecore TDS menu that allows you to add items to a TDS project:
This will bring up the Get Sitecore Items dialog at the node you have selected. Once an item has been added to a Sitecore TDS project you can Sync the item and its children from the Rocks menu:
The difficulty of a Sitecore upgrade can vary depending on how much has changed between the current and target version of Sitecore. Sitecore TDS can help during the upgrade process, but should not be used to perform the actual upgrade. Sitecore invests a significant amount of resources testing their upgrade procedures, and Sitecore TDS is not part of that testing. Sitecore TDS helps during the upgrade process by allowing the development team to compare the upgraded Sitecore instance with the latest version of the project using the Sync Window. This can help pinpoint places where the changes made by the Sitecore upgrade may affect the Sitecore implementation. Each Sitecore upgrade is different. We start with the typical scenario shown below and make changes to the plan where needed based on our findings during the upgrade.
The steps above are a good starting point, but are not a complete upgrade plan. There are a number of places where backups and testing would be done, but these steps have been omitted for simplicity.
Sitecore 9.2 allows developers to choose the format Sitecore will use when serializing items into the TDS project. The two formats supported by Sitecore are Item serialization and Yaml. TDS projects support quick and easy conversion from Item format to Yaml to make moving to the more modern serialization format quick and easy.
Upgrading your Sitecore items to Yaml is very easy. The first step is to open the general property tab for the project and change the Serialization Format to YML Serialization. You will be prompted to continue:
Choosing “Yes” will open a dialog with a listing of all .item files in the project.
Clickig Ok will perform the upgrade. When the upgrade is complete, all .item files in the project will be removed and replaced with .yml files with the same name. All settings in the TDS project will be preserved, making the upgrade nearly effortless.