Copied to clipboard

Flag this post as spam?

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


  • Dmitriy 168 posts 588 karma points
    Apr 23, 2019 @ 11:32
    Dmitriy
    0

    Multilingual 404 error with xpath

    Hello, Umbracians

    Here is my current umbracoSettings.config

    <error404>//errorPage[@nodeName='404']</error404>
    

    All I want it make the 404 page multilingual searching independent of id:

    <error404>
        <errorPage culture="default">0001</errorPage>
        <errorPage culture="en-US">0002</errorPage>
    </error404> 
    

    But, unfortunatly I am not famialiar with xpath syntaxt so well. How to imlement something like that:

    <error404>
            <errorPage culture="default">//errorPage[nodeName='404' & Culture='fr-fr']</errorPage>
            <errorPage culture="en-US">//errorPage[nodeName='404' & Culture='en-us']</errorPage>
        </error404> 
    

    Is it possible with xpath?

  • Matt Barlow | jacker.io 164 posts 740 karma points c-trib
    Apr 23, 2019 @ 12:15
    Matt Barlow | jacker.io
    100

    You can but you would have to add a culture property to your document type for the errorPage:

    So this would match the first document of type errorPage, that is called 404 and has a property of culture called fr-fr.

    (//errorPage[@nodeName='404' and culture='fr-fr'])[1]
    
Please Sign in or register to post replies

Write your reply to:

Draft