Incorrect url when creating content inside a list

Topics: Troubleshooting
Aug 16, 2011 at 9:37 AM

When authoring content that is inside a list the url that is first created does not include the list slug.  I've noticed that if you re-save or publish the content then the url is updated to the correct path.

Just to make sure it wasn't something I have caused, I downloaded the code from Clint Edmonson's day of .net from http://www.notsotrivial.net/blog/post/2011/08/08/Slides-from-my-St-Louis-Day-of-NET-2011-sessions.aspx If you create a new session, you do not get the /session/ prefix on the content url.  The only way it seems to work is if you visit the list and create a new session from there, which seems a bit long winded!

Is this a bug or by design?

Thanks for any help.

Aug 18, 2011 at 9:04 AM

bump... do most people add content to their lists via the list rather than adding the new content item within a list and therefore not see this issue?  Am I making sense?!

Coordinator
Aug 18, 2011 at 6:46 PM

This is by design. The list adds the slug prefix, and you might create any content item without adding it to the list.

Aug 18, 2011 at 7:20 PM

Thats fair enough, but if you *do* add it to a list shouldn't the slug prefix be added when saved? The  resulting url is incorrect until you make a change to the item and it is updated on the save.  Do you think it could be improved to handle this case or is it not worth it, given the changes coming up in 2.0?

Thanks for your help

Coordinator
Aug 18, 2011 at 7:41 PM

The slug generation is drive by the Edit UI. So this might sound as bug. But whatever, next version will get a brand new slug generation mecanism, look at Bertrand's blog.

http://weblogs.asp.net/bleroy/archive/2011/07/30/future-orchard-part-3-autoroute.aspx

Aug 18, 2011 at 9:04 PM

Ok thanks for your help.  Yeah looking forward to having that functionality, very cool :)