Working with Sitecore, Part Eight: A different way to think about Sitecore

Monday, March 25, 2013 @ 02:08

By: Josh Jenkins, Lead Consultant

You've probably read the tagline for my blog, "It is the mark of the mind untrained to take its own processes as valid for all men, and its own judgments for absolute truth." It's a quote from Aleister Crowley about hubris — exaggerated pride or self-confidence.

I am not telling you how to do something here, I'm just telling you how I do it. (Though I've been known to change my mind a lot...)

I can't pretend I've dug deep into DMS or eCommerce or the ECM. Sure, I've played around with all of them and have a good level of understanding, but for the past few years I've been deep in the trenches doing new implementations.

In no order of importance when working with Sitecore things I've learned:

  • I use Component-based Architecture and I've gone over that already.
  • I think of Sitecore Templates in three ways: as interfaces, as presentation placeholders and as containers
  • I name my data templates, the ones I think of as interfaces, with a preceding "I" just like I would do in .Net (Even though Uncle Bob disagrees).
  • In my data templates I always prefix my fields with the name of the component. You just never know when you'll inherit two templates who share the same field names.
  • I use presentation templates to aggregate all the data templates into one place and add presentation details to display those components
  • I use container templates to aggregate a collection of items based on a template (a folder of Blog posts for example)
  • I use one Layout for a site, and that layout is as generic as possible. I call these PageTypes, borrowing from Jens Mikklesen

 

  • I use many sublayouts that I call PageLayouts for things like a home page, blog post, news item, product, and so on. The trade off is that I can swap out functionality incredibly easily but the Presentation Details of my presentation templates can and often do contain a lot of controls. These are the presentation templates I mentioned above
  • I refer to my placeholder using the placeholder heiarchy when attaching them to presentation details
  • I could care less about prefix naming of Sublayouts and Layouts. Naming things ltMain or sltHome vs. MainLayout or HomeSublayout vs. Main or Home. Since I could care less I'll do it if it helps the other devs on my team. I find that one it's broken into components and placed in logical groupings it makes sense without the need for all that
  • I make sure to add dictionary entries for static text elements on templates to make localization easier down the line, even if I don't think it's going to me localized later
  • Think about the Page Editor early on becuase it requires it's own considerations, check out this presentation The Sitecore Page Editor: Unleashed by Nick Wesselman on using the Page Editor
  • Roundedcube has some good posts 10 Resolutions for Sitecore Developers and 3 Tips for New Sitecore Architects I'd suggest reading
  • Make sure to check out the Sitecore Virtual Users Group
  • Sitecore has an active developer community follow them on Twitter and subscribe to thier blogs! There are even a few Twitter lists already setup to help get you started: Sean Kearney's MVP List, Sitecore's 2012 MVP List, and Sitecore's 2013 MVP List
  • Check out the Sitecore Techinical Blogs
  • Sitecore's documentation is your friend. I suggest just reading one a day. Really, I'm not kidding
  • Read the Scaling Guide, SQL Replication Guide, Security Reference, Security Hardening Guide, CMS Performance Tuning Guide, and the CMS Diagnostics Guide. Twice.
  • Sitecore Support is worth its weight in gold. Do not spend hours or days banging your head against a wall. Pull up your big boy pants and ask them for help. You're paying for it anyways.
  • Whether you use Web Forms or MVP I suggest either creating your own model or using something like Glass Mapper
  • Did I mention using Glass Mapper? Oh I did? There are others and in the end it is your choice, but using some thing is better than nothing
  • You'll notice that most of this applies to Web Forms projects. Until recently I haven't played much with Sitecore MVC. I just started to do a project in it and am sure I'll have more on that at some point. For now that is about all I can think of, but I am sure I'll come up with some more soon!

    Previously, Part Seven: Setting Up Your Solution