Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Articles and Article doctypes #35

Closed
TimGeyssens opened this issue Oct 8, 2020 · 11 comments
Closed

Setup Articles and Article doctypes #35

TimGeyssens opened this issue Oct 8, 2020 · 11 comments
Labels

Comments

@TimGeyssens
Copy link
Owner

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

@prgriffithsdev
Copy link
Contributor

prgriffithsdev commented Oct 9, 2020

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
Copy link
Owner Author

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
Copy link
Contributor

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
Copy link
Contributor

prgriffithsdev commented Oct 9, 2020

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

  • News Landing Page (displays all news children)

  • News Page (the news content)

  • Blog Landing Page (displays all news children)

  • Blog Page (the blog content)

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
Copy link
Owner Author

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

  • Composition -> Content -> has a property of type block editor

  • Composition -> Header -> has header image , intro text

  • Composition -> Teaser -> has teaser image / teaser text

  • Page -> Article Landing Page -> this one uses a custom listview for articles

  • Page -> Article Page -> add a radiobutton property,we can then tag the items with blog/news/article (maybe we can swap this later with some sort of editor defined setting, but for now the radiobuttons will do)

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

Make sense?

Cheers,
Tim

@TimGeyssens
Copy link
Owner Author

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

@TimGeyssens
Copy link
Owner Author

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
Copy link
Contributor

prgriffithsdev commented Oct 10, 2020

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
Copy link
Owner Author

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
Copy link
Contributor

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
Copy link
Owner Author

Yeah nice, merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants