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

V15: Update navigation references in Partial Views #17613

Open
wants to merge 3 commits into
base: v15/dev
Choose a base branch
from

Conversation

elit0451
Copy link
Member

Details

  • Use the updated PublishedContentExtensions methods in the following partial view snippets:
    • Breadcrumb;
    • List Ancestors From Current Page;
    • List Child Pages From Current Page;
    • List Child Pages Ordered By Date;
    • List Child Pages Ordered By Name;
    • List Child Pages With Doctype;
    • Navigation;
    • Site Map.

Test

  • Create a simple content type with template and a title string property;
  • Create a nested content tree structure, something like:
Home
   - Child 1
     - Grandchild 1
     - Grandchild 2
   - Child 2
     - Grandchild 3
       - Great-grandchild 1
   - Child 3
     - Grandchild 4
  • Create new Partial Views from the following snippets (using the Partial View tree in the Settings section):
    • Breadcrumb;
    • List Ancestors From Current Page;
    • List Child Pages From Current Page;
    • List Child Pages Ordered By Date;
    • List Child Pages Ordered By Name;
    • List Child Pages With Doctype;
    • Navigation;
    • Site Map.
  • Add this to your content template:
@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@{
	Layout = null;
}

<h1>Hello from "@Model.Value("title")"</h1>

<hr>
<h2>Breadcrumbs</h2>
@await Html.PartialAsync("Breadcrumbs")

<hr>
<h2>ListAncestorsFromCurrentPage</h2>
@await Html.PartialAsync("ListAncestorsFromCurrentPage")

<hr>
<h2>ListChildPagesFromCurrentPage</h2>
@await Html.PartialAsync("ListChildPagesFromCurrentPage")

<hr>
<h2>ListChildPagesOrderedByDate</h2>
@await Html.PartialAsync("ListChildPagesOrderedByDate")

<hr>
<h2>ListChildPagesOrderedByName</h2>
@await Html.PartialAsync("ListChildPagesOrderedByName")

<hr>
<h2>ListChildPagesWithDoctype</h2>
@await Html.PartialAsync("ListChildPagesWithDoctype")

<hr>
<h2>ListDescendantsFromCurrentPage</h2>
@await Html.PartialAsync("ListDescendantsFromCurrentPage")

<hr>
<h2>Navigation</h2>
@await Html.PartialAsync("Navigation")

<hr>
<h2>SiteMap</h2>
@await Html.PartialAsync("SiteMap")
  • View the Home page and click on the different links and verify that the page information is correct.

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

Successfully merging this pull request may close these issues.

1 participant