TimGeyssens / Umbraco-v8-Community-Website-StarterKit

The goal of this repo is to have a community managed starter project/kit for #umbraco v8 following the best practices and showcasing nice tips and tricks
https://dev.to/timgeyssens/how-to-join-the-fun-and-get-started-with-contributing-to-the-umbraco-community-starter-project-kit-36gn
MIT License
18 stars 12 forks source link

Setup Articles and Article doctypes #35

Closed TimGeyssens closed 3 years ago

TimGeyssens commented 3 years ago

Part of the site is a news/blog/articles bit... so we need those doctypes setup :)

prgriffithsdev commented 3 years ago

Hey Tim, ill pick this up next (ill try take a look during my dinner time). For my projects, I typically create a couple of compositions One called 'page default' that has a heading, main content (and whatever else i.e image) which is typically used for the page e.g. the article, and one called 'page banner default' that has a banner image, heading, main content, and (and whatever else), this I use for landing pages that display children e.g. 'Articles'. The Articles and Article will then inherit one of these base page compositions as well as other things like SEO etc.

Let me know if you like this idea and ill create them, i guess it depends on the wireframes and if a banner is used on landing pages that list children

TimGeyssens commented 3 years ago

sounds good, just to make sure with inherit you mean use the composition? Not using doctype inheritance right? Main content will be done with the new blocks editor :) but a composition sounds ace!

prgriffithsdev commented 3 years ago

Yes sorry, inherit == composition. If I add what I think then you can review, I've not used Block Editor yet. Im happy to be told to change things if its not as expected or can be improved etc. Just let me know

prgriffithsdev commented 3 years ago

I have a question on the structure for this @TimGeyssens . Usually, regardless if properties are similar or sometimes identical I create separate doc types for each 'type' (where it could change in the future) e.g. for news, a blog I would have

There is an argument that creating a doctype per type is overkill and if doc types share identical properties then it may be better to create a generic doctype e.g. Landing Page and Page which can be used for both of the above. However, if on the home page and you want to display the last 4 blog posts when you are traversing the content tree how do you identify if its the blog landing page versus the news landing page? If you have a separate doctype for each you can look for the type in code

var blogLandingPage = homePage.Children.OfType<BlogLandingPage>().FirstOrDefault();

What do you recommend here? If you wanted a different property on a blog that wasn't needed on news if they are built separately you have that flexibility to add in the additional property without having a redundant property on a doctype where it is not needed

I started pulling things together but It's difficult trying to build up doc types when I've not really got a good understanding of how you want this structured?

example: image

The 'main content' can be changed to the block editor, above is an example

Hope that makes sense

Paul

TimGeyssens commented 3 years ago

Hey hmmm let me think.... I don't want to over complicate things ... so good call, thanks for the input 👍

Then on homepage and stuff we query by the property value to filter...

Make sense?

Cheers, Tim

TimGeyssens commented 3 years ago

And we can still refactor afterwards, but that will do for now I think... feel free to share extra input :)

TimGeyssens commented 3 years ago

Like use contentment and show folks how that works: https://dev.to/timgeyssens/content-editor-defined-dropdowns-checkboxlists-and-radiobuttonlists-in-umbraco-v8-with-contentment-123f but I'll setup a new task for that one... cool to just use a radiobuttonlist for now?

prgriffithsdev commented 3 years ago

Hey Tim, missed that last comment sorry, ill take a look at the link. I made a commit to the repo this morning so let me know your thoughts. All negative feedback welcome, its how we learn 👍

TimGeyssens commented 3 years ago

Sweet stuff! No need to say sorry @prgriffithsdev this is all volunteer work :) look good, just noticed that the build check is failing, you might have missed 2 files... details in the pr #63 , thanks! And negative feedback isn't needed, just some tips, I can also learn :) love the little details with the fall back image :)

prgriffithsdev commented 3 years ago

Good stuff! Yeah, I included a fallback in the code but we could easily add in a new tab called 'placeholders' or 'defaults' on the settings doctype to house all the fallbacks. Typically editors will add images and you never see the fallback but its there for the 'just in case' scenario. Missing models are now committed and build is verified. I can work more on this when we have an idea of markup and any additional properties that are required for an article.

TimGeyssens commented 3 years ago

Yeah nice, merged!