Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Rud 261 posts 1022 karma points c-trib
    May 05, 2024 @ 14:27
    Martin Rud
    0

    404 page with ContentXPath does not work

    I have this appSettings.json:

    "Umbraco": {
        "CMS": {
          "Global": {
            "Id": "7d8ef44c-0e07-443c-8e17-5a25f6ed068c",
            "SanitizeTinyMce": true
          },
          "Content": {
            "AllowEditInvariantFromNonDefault": true,
            "ContentVersionCleanupPolicy": {
              "EnableCleanup": true
            },
            "Error404Collection": [
              {
                "Culture": "default",
                "ContentXPath": "//PageError404"
              }
            ]
          }
              ....
    

    And these pages:

    • Home
      • Subpage 1
      • Subpage 2
      • Page not found (doc type alias = "PageError404")

    According to the documentation on https://docs.umbraco.com/umbraco-cms/tutorials/custom-error-page it should work:

    {
        "Umbraco": {
            "CMS": {
                "Content": {
                    "Error404Collection": [
                        {
                            "Culture": "default",
                            "ContentXPath": "//errorPages[@nodeName='My cool error']"
                        }
                    ]
                }
            }
        }
    }
    

    But I just get the default Umbraco 404 page.

    Umbraco 13.3.0.

  • Martin Rud 261 posts 1022 karma points c-trib
    May 05, 2024 @ 16:34
    Martin Rud
    100

    I now se that the docs say: "The current implementation of XPath is suboptimal, marked as obsolete, and scheduled for removal in Umbraco 14. The replacement for ContentXPath is IContentLastChanceFinder."

    I will wait for v14 and use id or key for now.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies