4

Sitecore best practice says to use datasource but habitat doesn't seem to follow this. At many places in habitat, content is in the item, instead of linked through datasource. Can someone explain me if there are any reasons behind this or best practise for this has not not been followed in habitat. Thanks

1
  • List some specific examples, please.
    – Mark Cassidy
    Commented Feb 4, 2017 at 11:32

1 Answer 1

5

As we don't (yet) know which example you have in mind, I'll give my general opinion: although it is best practice to use datasources, it might not be best practice to use them for everything. Your content editors could go completely crazy if they need to quickly publish a news article and they need to create 5 datasources and a content item to achieve that (Sitecore will seem overwhelming to lots of people if you do that). Best practice is actually to think about your content architecture and create something that enables your content editors to work fluently and give them and the marketers the ability to do their (marketing) job - meaning let them personalize, test, etc.. renderings where needed.

Even in SXA not all components use a datasource. The title of the page is picked from the item itself. This does not mean you need to do that always, but in many cases it might be a good idea. Talk to the customer, the editors and the marketers that will administer the site and decide based on that information how the content should be structured (so they can do their job and the site is still performing well) and how and where to use renderings with datasources.

ps: sometimes it can also be a good idea to let an editor assign a datasource optionally (take the current item if no datasource was set).

5
  • IMO that is always best practice and the way IA in Sitecore is intended. sitecore.stackexchange.com/questions/1864/…
    – Mark Cassidy
    Commented Feb 4, 2017 at 12:52
  • I see your point and do agree that using datasources should always be the first thought, but I don't think it should be "carved in stone" as a must everywhere. But this discussion makes this question actually a duplicate of the one you are linking to, not?
    – Gatogordo
    Commented Feb 4, 2017 at 12:59
  • Thanks Gatogordo for the answer. By the way i was referring site logo and primary navigation items which are not linked through datasource in habitat. Actually I was thinking from personalisation point of view for primary navigation.
    – S.Kazmi
    Commented Feb 4, 2017 at 13:33
  • 1
    Well that is answered in the linked post. As long as the individual components make no assumptions beyond their assigned template (and only rely in the Interface Base Template) - having an actual datasource set is optional.
    – Mark Cassidy
    Commented Feb 4, 2017 at 13:38
  • 2
    If your component needs to be personalized, datasources are a must. Do be aware though that you might not want to confuse visitors with a primary navigation that changes all the time ;)
    – Gatogordo
    Commented Feb 4, 2017 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.