1
votes

I'm trying to make my Umbraco layout. I have set up Umbraco before and used it, but my layout was as following:

- Home
-- About Us Page
-- Products Page
-- etc. etc.

That structure allowed me to visit / and get the home page, but having the subpages (About Us and Products) as children of Home does not make any sense. They are not connected together at all, except they all use a Master template.

If I want to make a better structured setup for my new page, I would assume this would be the best approach:

- Master
-- Home Page
-- About Us Page
-- Products Page
-- etc. etc.

However, this would mean that visiting / would give me the Master template without content, but visiting /home would give me what I want.

So what is the most ideal setup? It seems weird they are all inheriting from the Home document type, because that's what my / root page should be.

4
You are messing up "template" and page. Sometimes you mean page (or node) while you write template. As you know, a template is a different concept in Umbraco, being the "view".dampee

4 Answers

1
votes

I would stick to your original plan & nest everything under Home. Having your homepage under /home/ is a bit clunky.

I use the home template as a container for all the data that is likely to be used in pages throughout the site, so I have a 'copy' section so that there is a place for every page for headline, subheadline, blurb & hero image. By using the home doc type these values can reduce complexity in back end code (if you know every page has a 'headline' field you can use it in a macro without referring to anything else or getting hit by typos).

I also have a bunch of SEO fields, social media integration, as well as navigation fields.

So use the home doctype for what is specifically on the homepage & also for stuff that is universal to the site - hopefully that is a good enough reason to setup all content under home.

1
votes

Template structure is not the same as content structure.

Your content tree, which is what your plan reflects, is the structure of your site. Consider it as having the same structure as you might see in your breadcrumbs, Home always nests everything else.

Home > Products > Product 1

Your first plan is correct for Umbraco

0
votes

The only reason why you would want a structure like this

- website
  -- home
  -- about page
  -- product page

is if you want to swap out the "home" page for a different home page.

You can work around the issue by creating a WebsiteContentFinder serving the correct "home" by creating a ContentFinder. If you do so, do add a "homepage" property on the website node, to avoid searching all the children and only picking the first one...

0
votes

You can achieve the second one by adding a "Content Picker" property in your Master with an alias of "umbracoRedirect"

No additional code needed that is automated by Umbraco, just select your Home Page from Master using content picker property.

You can now then access "/" displaying the homepage content.

Screenshots: enter image description here

enter image description here