Copied to clipboard

Flag this post as spam?

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


  • Michiel (NSC) 95 posts 115 karma points
    Oct 06, 2011 @ 11:12
    Michiel (NSC)
    0

    Page not found, but why does the xpath query skip one level of nodes?

    I have multiple root nodes like this:

    • en
    • fr
    • de
    • nl
    • zh
    All but the first have a hostname and language set. I also have the following configuration:
    • web.config\appSettings\umbracoHideTopLevelNodeFromPath: true
    • umbracoConfig\requestHandler\useDomainPrefixes: true
    For any child node called test I want to access them like this:
    • /test
    • /fr/test
    • /de/test
    • /nl/test
    • /zh/test
    But only the first URL results in a page found. The others URL all result in page not found
    And this is even though the CMS reports those URLs as Link to document, so I would expect them to work. 
    Looking at the xpath query, I notice it is skipping one level:
    /root/*/* [@urlName = "fr"]/* [@urlName = "test"] | /root/* [@urlName = "test"]
    Why is that so? What can I do to make this work? 
    Also, should I report this as a bug, because the CMS UI reports a link that does not actually work? Where is the exact, technical documentation for the configuration settings I mentioned above?
    Argh!
    :)

  • Rodion Novoselov 694 posts 859 karma points
    Oct 06, 2011 @ 12:35
    Rodion Novoselov
    0

    If you want to access your items in the style like /test, /fr/test etc you need quite opposite settings: umbracoHideTopLevelNodeFromPath = false, useDomainPrefixes = false (actually, afaik, both are default).

    Your current settings suggest that nodes are accessible by URLs like www.yourdomain.com/, fr.yourdomain.com/, de.yourdomain.com/ and so on.

  • Michiel (NSC) 95 posts 115 karma points
    Oct 06, 2011 @ 15:32
    Michiel (NSC)
    0

    I'm confused. Where are these settings described?

     

  • Rodion Novoselov 694 posts 859 karma points
    Oct 06, 2011 @ 15:54
    Rodion Novoselov
    1

    I haven't seen them in some sort of official documentation in existance (i.e. wiki), but in general it can be discovered in the source code and actually can be guessed from the names as well.

    As far as I understand (probably there's someone who has better knowledge on it and can correct me if i'm wrong) these settings control how node URLs are generated (for instance with niceUrl(...)):

    1) umbracoHideTopLevelNodeFromPath ( = true/false)

    If you have such a structure, for example:

    Home
        Contact
        About

    then the relative URLs in one case (true) will be /, /contact.aspx, /about.aspx (or /, /contact, /about if you turn 'folder urls' on)

    and in the other case (false): /home.aspx, /home/contact.aspx, /home/about.aspx


    2) useDomainPrefixes (= true/false)

    means whether a domain will be added to the url, i.e. www.mydomain.com/about.aspx vs /about.aspx and so on.

  • Michiel (NSC) 95 posts 115 karma points
    Oct 07, 2011 @ 11:29
    Michiel (NSC)
    0

    Cool, thanks for the info.

    It's a lot of work to have to look in the source to understand these options, although I now do have a working copy here (and even fixed a bug in the URL generation). 

    Two problems I faced for understanding these options were:

    1. Though the names mau be clear, it's not clear where Umbraco uses these options. Generating a URL is different than routing a request. So while your explanation focusses on generating URLs, I encountered problems when requestin pages (page not found). 
      So I think these settings also influence the xpath queries used for routing requests to pages. 
    2. Combining these two options gives strange results. With both set to true the first node doesn't use the top level node in URLs, but any extra root node do. 
Please Sign in or register to post replies

Write your reply to:

Draft