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

Merged
merged 3 commits into from
Nov 25, 2024

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.

@Zeegaan
Copy link
Member

Zeegaan commented Nov 25, 2024

Looks good, tests good 🚀

@Zeegaan Zeegaan merged commit 4a19d89 into v15/dev Nov 25, 2024
18 checks passed
@Zeegaan Zeegaan deleted the v15/bugfix/update-navigation-references-in-views branch November 25, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants