Copied to clipboard

Flag this post as spam?

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


  • Victor 25 posts 146 karma points
    May 03, 2017 @ 16:11
    Victor
    0

    Using umbracoUrlAlias and culture hostnames

    Hi, I'm having a problem when using umbracoUrlAlias and adding a hostname for a different language. The page doesn't work when using CurrentPage property.

    For example: I've an about page that it's URL is localhost.com/en/page/about (with hostname)

    I added the umbracoUrlAlias to be just about, but I wanted it to be like localhost/en/about

    after doing that my about page loses it's reference and it starts referencing my home page, which all pages inherits.

    Is it possible to use culture and hostnames with umbracoUrlAlias? I'm having to do this workaround because I added some blank pages without templates just for a better usability on the back office, and that created the page section on the URL that I mentioned earlier which I don't want in the URL.

    This is my tree structure:

    • Home
      • Institutional
        • About
      • Other menus

    Thanks for the help.

  • Amir Khan 1282 posts 2739 karma points
    May 03, 2017 @ 17:12
    Amir Khan
    0

    Hi Victor,

    Not a direct answer to your question related to umbracoUrlAlias, but this package might be a better option to hide specific url segments like you're wanting to do.

    https://our.umbraco.org/projects/website-utilities/virtualnodes/

    Hope this helps,

    Amir

  • Victor 25 posts 146 karma points
    May 03, 2017 @ 18:43
    Victor
    0

    I added the <add key="virtualnode" value="docTypeToMakeVirtual"/>

    to my Web.config file in the root folder of my project, but there is also a web.config file inside the umbraco folder and the views folder.

    Which folder is the right one?

    Anyway, I added to the web.config file on the project root folder, but now I'm getting Index was outside the bounds of array. It did seem to work at first glance, because I looked at the URLs that were previously having the page before them, and it was removed.

  • Amir Khan 1282 posts 2739 karma points
    May 03, 2017 @ 18:59
    Amir Khan
    0

    Hi Victor, its the one in the root you want. You'll just want to change "docTypeToMakeVirtual" to the actual document type of the "page" you're wanting to hide.

    Regarding the error, wondering if you added the key for virtualNode twice?

    -Amir

  • Victor 25 posts 146 karma points
    May 03, 2017 @ 19:10
    Victor
    0

    Yep, I added only one key with multiple document types seperated by commas, like this:

    <add key="virtualnode" value="separadoresMenu,associadosMenu,assuntosLegislativosMenu,comunicacaoMenu,contribuicoesMenu,convencoesColetivasTrabalhoMenu,faleConoscoMenu,institucionalMenu"/>
    

    This is a picture of my document types and how they are created on the content: Images

    EDIT: I just checked my property tab on a published content, and it said this: "This document is published but its url would collide with content (error)"

  • Amir Khan 1282 posts 2739 karma points
    May 03, 2017 @ 19:15
    Amir Khan
    0

    Hmm, sure the error is not related to code on the site outside of that package?

  • Victor 25 posts 146 karma points
    May 03, 2017 @ 19:19
    Victor
    0

    Yes, if I remove the add key everything works back as normal.

    EDIT: if I manually add the virtual node that was suppose to be hidden, it works as well. But when I remove to see if the package is working, the error happens.

    When I add the key, on my index, I can see where the links are going, and they do not have the previous content URL, but when I click on them, I get the error. Removing the key fixes this.

  • Victor 25 posts 146 karma points
    May 04, 2017 @ 19:52
    Victor
    0

    Is there other way to solve this? Thanks for helping Amir.

  • Victor 25 posts 146 karma points
    May 17, 2017 @ 17:41
    Victor
    0

    I've been recently using culture and hostnames to get a closer result. But I've two nodes that has to have the same URL:

    • Home
      • Page1
    • News
      • Page1
        • News article

    I thought about putting on as a children of Home/Page1 but I'm letting the user create pages, by making the children of the page being html layouts. Because of that I think it wouldn't be a good display to have the news inside the Page1. Is there another way or structure to do this?

Please Sign in or register to post replies

Write your reply to:

Draft