sug bangalore - kick off session
TRANSCRIPT
SITECORE USER GROUP BANGALORE: KICK OFF MEETHOSTED & SPONSORED BY VERNDALE
MARCH 28TH 2015
COPYRIGHT 20151
Sitecore is one of the leading enterprise-level content management systems built on ASP.NET, enabling web content editors and marketers to have full control over all aspects of their website from social integration and blog posts to advanced personalisation, e-commerce and more.
SITECORE
COPYRIGHT 20153
• Powerful development platform, based on the latest Microsoft technology.
• Pipeline based architecture that is open and extensible
• Page Designer – content on the fly
• Strong multisite support
• Multi language flexibility
• Advanced security
• Powerful workflow
INTRODUCTION TO SITECORE
COPYRIGHT 20154
• True separation of concerns – Do you see the light?
• View Renderings vs Controller Renderings
• Always do a datasource null check in the beginning of the view
• Display placeholder text in the event of no datasource in pageeditormode
TIPS ON SITECORE MVC USAGE
COPYRIGHT 20156
• Yes we don’t like empty html tags – but we need to ensure they show up in page editor mode with the item field in question!
• Add comments to demark the start and end of renderings – it will make your life simpler!
• Grouping controllers rendering actions – to do or not to do?
• Accessing non-rendering actions (ajax?)/api/sitecore/samplecontroller/sampleaction?sampleparam=abc
• Post actions – Html.Post vs Ajax.Post
TIPS ON SITECORE MVC USAGE
COPYRIGHT 20157
Team Development for Sitecore (TDS) gives you the ability to keep track of
all the Sitecore items in your project, by bringing them into a Microsoft
compliant Source Code Control system.
Key concept: Serialization of Sitecore (Database) Items into Files
TDS
COPYRIGHT 20158
Source:
http://www.hhogdev.com/product
s/team-development-for-
sitecore/overview.aspx
TDS
COPYRIGHT 20159
In Short: Advangates of TDS Version control for Sitecore Items!
Extensive TDS documentation: http://hedgehogdevelopment.github.io/tds/
TDS
COPYRIGHT 201510
• Complete accountability and audit trail.
• All of your Sitecore items and code are stored in a single repository.
• Developers can work remotely or disconnected from the network and then sync and
merge changes at a later date to the source code control system.
• You can easily compare versions of items and code.
• You can rollback to prior versions if there is a problem.
• You can easily merge changes.
• Branching and other advanced source code management techniques can be leveraged.
• Continuous integration and automated builds.
TDS
COPYRIGHT 201511
• TDS sync vs TDS deploy
• Avoid conflicts – save your timeGet latest before you attempt check in to avoid bad merge (TFS)
• Use the TDS buildSeparation of working vs deployment directory – additional façade.
Keep the hefty sitecore folder outside of your source control!
• Keep your project paths short, and keep an eye on your sitecore item name lengths as well
256 characters file path size limit
TIPS ON TDS USAGE
COPYRIGHT 201513
• Sync in only necessary items- Excessive content, fairly constant sitecore items which come in with a fresh install – good
examples of items you wouldn’t need in your TDS project
- Use NoChildSynchronization where needed.
• Duplicate item names in same section not supported
TIPS ON TDS USAGE
COPYRIGHT 201514
Unicorn (for automatic serialization of your changes to Sitecore items)
Courier (for package generation based on serialized items)
Sitecore Ship (for automated deployment of Sitecore packages)
Combination of the above open source tools will enable you achieve the
same results!
Credit: http://stackoverflow.com/users/181142/ruud-van-falier
ALTERNATIVE SOLUTION
COPYRIGHT 201515
Glass is home to the #1 ORM for Sitecore and Umbraco. Glass.Mapper is the easiest way to map data from your Sitecore or Umbraco solution to your code. http://www.glass.lu/
Extensive tutorials available at: http://www.glass.lu/en/Mapper/Sc/Tutorials
GLASS.MAPPER
COPYRIGHT 201517
• Use Glass generated models wherever you possibly can
• Always add null checks before rendering item fields.
• Your glassmapper model and version control (TFS) merge issuesSolution - Delete model - regenerate
• Keep your data clean – avoid mapping exceptions!
Ensure your Broken Links Report is clean
TIPS ON GLASS.MAPPER USAGE
COPYRIGHT 201520
• Keep page editor support in mind at all times!
• Override glass html helpers in GlassView as and when needed based on your requirements
Eg. Resized images in normal mode
• Keep an eye on the size of your model file. Split your TDS projects if necessary
Only generate code for items that you NEED to use in your code
Remember – child items inherit the code generation property from parent!
TIPS ON GLASS.MAPPER USAGE
COPYRIGHT 201521
• Update the header tt file if need be.Eg. System templates, template Id
• ‘Error generating code’ issue – one formula – Delete model.cs, regenerate!
• When to create Custom Models?
TIPS ON GLASS.MAPPER USAGE
COPYRIGHT 201522
• May / June 2015
• Front end coding workflow for Sitecore Sites
• Slot open for ideas / requests!?
Mail us at: [email protected]
Join us
https://www.linkedin.com/groups?gid=6700964
www.meetup.com/sug-bangalore
Follow us on Twitter @sugblr
FOR THE NEXT SUG BANGALORE SESSION
COPYRIGHT 201524