0

I'm new to umbraco and using umbraco 6 latest version... Actually this is a silly mistake but makes me curious..

I've two content, let's say item a and item b.. This two item will be published alternately. so it can be access via "mysite/item_active"..

Today -> item a -> change name to item_active -> save publish -> change yesterday item active to item_b..

But somehow I forgot to use save publish yesterday.. And only click save that make the url of the content is not being updated..

Then how umbraco will choose with item to render (both item now have "mysite/item_active" url)?

The day I asked you is holiday until monday.. And I don't have access this site (because this internal company site) from home..

Are based on node? the smaller node is the one being render or the latest publish item will be rendered?

gill23
  • 593
  • 1
  • 5
  • 19

1 Answers1

3

Umbraco won't allow you to save and publish two items with the same URL / node name (on the same tree level). It will automatically add version number e.g. (1) for the next node with the same name and then, friendly URL will become /mysite/item-active-1 in your case.

I tested this scenario, and Umbraco returns this information when you're trying to publish item with the same name as existing one: enter image description here

So, in theory - we have two items published, but only one is still in the XML (IPublishedContent) cache, from which Umbraco is taking content first. Second item won't be visible until we will change the URLs / names to be different or perform publish on first item and then scenario described at the beggining will be applied.

Maybe it's worth to consider having it as a same page and just swaping the templates on which you can render particular properties values? Or having a content picker or something else to determine which version of the site should be marked as active and used?

Marcin Zajkowski
  • 1,668
  • 10
  • 14
  • this is possible if you miss the publish, only save.. let say, item a -> save publish to item active -> url will be /item-active then change it back to item a without publish, the url will the same.. Then change item b -> save publish to item active -> url will /item-active .. So we have 2 same url – gill23 Oct 24 '16 at 00:08
  • 1
    Hmm I can see the problem. Umbraco returns this information as a result of my try: https://d17oy1vhnax1f7.cloudfront.net/items/2w2E2o19423u2G3S3e1c/Image%202016-10-24%20at%2010.26.45%20AM.png?v=7a11d051 (I tried to publish second item after first one was just saved). So, as the result, in theory - we have item 1 & 2 published, but item 1 is still in the XML cache, from which Umbraco is taking content - so the item 2 won't be visible until we get back to item 1 or change the URL / name to be different. – Marcin Zajkowski Oct 24 '16 at 08:29
  • Yeah.. I forgot to check the xml cache.. yup it's likely as per your comment – gill23 Oct 25 '16 at 01:10
  • Glad that it's sorted :) Try to think about having separated templates or even use nested content od content picker to determine which version of the site should be used as active one. – Marcin Zajkowski Oct 25 '16 at 09:11
  • Yup, nice suggestion.. thanks.. I will change it to content picker – gill23 Oct 26 '16 at 00:50
  • Ok. I've updated the answer. Maybe it will be helpful for someone else in the future :) Happy coding! – Marcin Zajkowski Oct 26 '16 at 08:21
  • Also, if you update using the Content Service, it doesn't check the URLs, so you can end up with duplicate URLs that way as well sometimes. – Tim Nov 24 '16 at 10:42