umbraco / Umbraco.Heartcore.Issues

3 stars 1 forks source link

Heartcore: root node url path #9

Open miguelcrpinto opened 3 years ago

miguelcrpinto commented 3 years ago

Issue description

Issue description In a "normal" umbraco setup, the nodes created at root level and that have a domain associated with it, do not have their name in the URL path (example: if you create a node at root level named "Home" and add a domain to this node, it's url path will simply be / instead of /home). In Heartcore, adding a domain to a note at root level is not possible (which makes total sense being a headless CMS) and therefore whatever nodes we create at root level will get their name in the URL path (example: if you create a node at root level named "Home" it's url path will be /home).

This is not ideal if you are building a website and simply want to use the URLs that Heartcore generates because your url paths would always include the root node path. (this is also a problem on the asp.net core mvc client nuget package)

Is there a way to force the root nodes to not have a url path or for its path to not be included in the paths of their descendants?

Proposed solution In Umbraco Heartcore, have you considered allowing the specification of an identifier for root nodes (instead of domain)? This could be then used to specify on which (sub)tree we want a url to be resolved, etc.

Let me know if you have any questions. I'm available to further discuss the problem and possible solutions.

Thanks Miguel

Frost117 commented 3 years ago

Heya @miguelcrpinto

Makes total sense the scenario that you put up, can definitely see this becoming a challenge to work around in different scenarios.

The proposed solution you made, would it not be possible for the project to use the Routing properties that the standard CMS ships with? https://our.umbraco.com/documentation/reference/routing/routing-properties

For a clearer view, I made a content node with the name Home, but the url for it is the danish word for Home: image

And for the information page of the content node. image

miguelcrpinto commented 3 years ago

@Frost117 that doesn't solve the issue because the root node would still have a path in its url instead of simply "/".

What I was proposing is that instead of using a domain (like in a normal umbraco setup), we would have the option to specify an id/slug or something like that and for the root nodes that have that, their url path would be simply "/". Whenever you would want to query the Heartcore API by url (or any of the other ways) you'd have the option to specify the Id of the root from where the url search should start from.

miguelcrpinto commented 3 years ago

any news/updates on my suggestion?

I was going through the issues list and I do not see much activity there. Are you still developing heartcore?

chris-evansnz commented 2 years ago

I'd also love to see this option, as it affects not just the root node but all pages, e.g. a page called About Us under Home has a url /home/about-us when it should really just be /about-us

image

Perhaps there can be a setting on the doctype, similar to the Allow At Root checkbox, but which suppresses its own name from the url path if the node is at root level, like the Umbraco.Core.HideTopLevelNodeFromPath key does in standard umbraco.

sitereactor commented 2 years ago

Thanks for the input! And this is because you want to reuse the url structure on your website, right? (Where the home node should not be used)

chris-evansnz commented 2 years ago

Ideally yes - it would be good to be able to use the urls that are generated by umbraco rather than having to work around them and trim off the prefix. would also give a bit more flexibility for how to run the IA on the site

RosenPetrov commented 2 years ago

Hey, we also need that functionality. Thanks. Also, I tried to rename the Home node to "/", Umbraco allowed me to and than started throwing errors and I had to recreate my tree.

sitereactor commented 2 years ago

Updated with note from the team as 'Under consideration'. Once we have figured out how to solve this in Heartcore we will update the feature request.

miguelcrpinto commented 1 week ago

Any updates on this? I believe that after the migration from Umbraco V8 to V13 (?) this would be something easier to achieve as the Umbraco API already supports this. When will this be available in the Content Delivery API?

jmf-umbraco commented 2 days ago

Hi @miguelcrpinto,

The biggest challenge for us is URL collisions. The Heartcore delivery platform was created around the assumption that every content item has a uinique URL. Changing this is difficult and we don't have plans for the near term.

This may be something we can address in a few months and we'll keep this issue updated when we know more.