Best practices and examples
s
I’ve been doing web development for a couple of decades but I’m new to .net and Umbraco. I’m working on my first Umbraco Cliud project and I’m concerned about not following best practices and standards. I don’t want to confuse anyone coming into this project later who is an experienced Umbraco developer. Are there any good resources beyond the documentation and forums? To me there seems to be a gap between the basics and more advanced topics, especially when it comes to philosophy, structure, etc. Things like where to store (and display) content that is outside of the page hierarchy like footer and page navigation. I know how I’d do it in other environments but I want to do Umbraco the Umbraco way, not shoehorn it into my narrow perspective. Any suggestions?
d
I thought this for a long time because when you ask 3 Umbraco devs how to do a single thing you'll likely get three different answers. And to be fair they will often be able to make a good case for their methods and techniques. Therefore it would be quite difficult to get everyone to agree on a 'best practice' process.
r
There has been a long running conversation about this, and tbh it’s not really resolved itself into a super coherent argument. 1. Having worked at a number of different agencies, they have their own flavour or where they do what.. 2. It’s more a philosophy, and there fore subjective.. in one sense .. it’s more important as you get in to multi site and multilingual 3. In terms of back office organisation.; the key part is signposting so that anyone picking it up understands what your structure is .. this also gos for normal back office users Typically I see a lot more Site - with global site settings —-Home page 1 ———site settings for home page 1 —-home page 2 ———-site setting for page 2 Site 2 - with global settings —-home page 1 - with settings —home page 2 with setting I do this because a number disagree But I’m here to start a conversation, the real key , is what you are doing sustainable and is it efficient.. and does it fit the client and the client requirement
s
Absolutely agreed with Dean here, there's so many ways to approach almost all topics. Which is why we have no documentation on exactly what to do, it would just be too much. We do have a page about things NOT to do though, which might be helpful: https://docs.umbraco.com/umbraco-cms/reference/common-pitfalls
k
Umbraco has documentation for most stuff, so as long as you follow the documentation, you are not likely to confuse future developers. Try to avoid writing lots of custom code for things that may be possible using out-of-the-box stuff would be my main recommendation. This is the only thing that confuses me about at Umbraco implementations. For example, huge helper methods to render things, or code to do complex lookups that could have been content pickers.
Regarding the other stuff, I too would like some "best practice sharing". For non-browsable content items, our current approach is to create a content root for each type of non-browsable content item - News, Products, etc. But we try to avoid these roots if possible. One other thing we avoid (didn't see it in the pitfalls) is doctype inheritance. We've had problems both with upgrades and with uSync because of inheritance so we use 100% compositions today. And use a composition called "layout/master" which is mandatory for all browsable doctypes and is used as the template model for the layout/master cshtml (i.e., Layout.cshtml is
UmbracoViewPage<ILayout>
even if it can't know the current page actually composes in
ILayout
).
We use custom labels for all blocklists on the format "Block type: Content summary" (e.g., "Hero: Welcome to Contoso") to make blocklists more editor-friendly. The labels are easier to configure when adding the block to the blocklist than retroactively.
s
technically speaking, doctype inheritance and compositions is actually the same. It's just the UI that is different.
s
Thanks for all the friendly input! I've gotten the hang of the settings structure and gotten my project running decently now. Still have a lot of questions though. 🙂
r
feel free to keep asking them , people will do what theycan to help you
3 Views