Sitecore Swamp

Dive in the Sitecore Swamp

NAVIGATION - SEARCH

Sitecore TDS Tips

  • Sync the templates/rendering first, then sync content
  • Sync and refresh until nothing comes up. TDS may not complete all the synchronizations in one sync, always refresh until no more new things are found. Sometimes, you maybe need to sync three or four times until everying in sync.
  • When you GLV (get latest version) from TFS, the TDS may not include all the items. When happens, It complains some errors about field missing. You can manually include the item into the project.
  • When you use TDS with GlassMapper CodeGen. After the TDS Sync, the code generated may not be perfect, errors sometimes. When it happens, simply right click the TDS project in VS solution explorer, and select Re-Generate Code for all items

Remove TFS workspaces

In command line prompt:

<workspacefoler>\"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe" workspaces /remove:*

note: Visual Studio 12 is Visual Studio 2013

Sitecore Best Practice - MVC

General

  • Use space in item name to provide better experience for content author, consider using Display Name for long item names
  • Do not use hyphen in any item name, and avoid using other special characters
  • Always create your own username in Sitecore and login with it
  • Do not use item name for display (rendering)

Template and Field

  • ​​All template should created under /content/templates/[Client Name]:
    • Page Template
      • ​​Represents a type of page​
      • Has layout and renderings preset in standard value​
      • Inherited from Page Base​
    • Component Template
      • Represents a view model of a rendering
      • Grouped in folder which reflects the co​ntroller na​​me
      • Inherited from Component Base​
    • Data Template
      • ​Any other template which is neither component nor page
      • Grouped in folder which reflects the purpose of usage​
      • Use meaningful name for Template and Field name, and avoid using  to provide better experience for content author
  • D​o not use hyphen in name 
  • Try to provide the source for a template field to reduce the effort for content author to lookup the entire content tree
  • Use item GUID as Sitecore field source to reduce the Sitecore refactoring effort​​​​
  • Assign the sortorder for template field section. Please see below the suggested sortorder:
    • Content/Data: 0 - 990 (not need to change)
    • Configuration: 1000 - 9900
    • Setting: 10000 -
  • Configure a meaningful icon for template
  • Configure the insert options in template standard value to reduce the effort for the content author to lookup the entire template tree ​
  • Use title and short description of field item to provide content author intructional text for that field.  

​​Layout and Rendering

  • Use View Rendering when the view model is Sitecore the template from context data source item with simple logic
  • Use Controller Rendering when the view model is built with  complex logic
  • Sitecore rendering should be grouped as epic under \content\layouts\rendering\[Client Name]\[Function Area]\[view]

TDS

  • [Client Name].TDS.Core 
    • core database items 
  • [Client Name].TDS.Master 
    • Layout items - /sitecore/Layout/Layouts/[Client Name] 
    • Rendering items- /sitecore/layout/Renderings/[Client Name] 
    • Templates items - /sitecore/templates/[Client Name] 
    • System items - /sitecore/System exclude the dictionary items 
  • [Client Name].TDS.Master.Content 
    • Content Items /sitecore/Content 
    • Dictionary items - /sitecore/System/Dictionary/[Client Name] ​
    • Media Items /sitecore/Media Library
  • ​Only add items into TDS if it's necessary

Configuration

  • ​Always patch the custom configuration in \App_Config\Include\custom\z.[configuration section].config​​.
  • To get the overview of Sitecore configuration, go to http://[sitename]/sitecore/admin/showconfig.aspx​​.
  • To get the overview of Sitecore cache, go to http://[sitename]/sitecore/admin/cache.aspx.

Display More Details in Visual Studio Build Output

If you demand more information from Visual Studio output when building the VS solution, here the way:

VS > Tools > Options > Projects and Solutions > Build and Run


By default, the minimal is selected, and it only displays the most important messages. Normally, I change it to Detailed, you will see the difference as much more information will be in the output. Together with VSColorOutput, you will have the best experience on the VS build output.