This project is read-only.

List autoroute bug

Topics: Core, General, Troubleshooting
May 21, 2012 at 4:14 AM

I've created a list called "Gallery" with the "<label class="forcheckbox" for="OnAdminMenu">Show on admin menu" option checked</label> with a title "Gallery", I've also created a content type called "Gallery Page" i've added the autoroute part to the Gallery Page with the pattern {Content.Container}/{Content.Slug} I have also selected "Automatically regenerate when editing content"

Now there is 2 navigation options to create a new gallery page:

1, from the "New" sub menu

2, From "Gallery" -> "Create New Gallery Page"

The difference in the 2 options above is whether or not the List the Gallery page will be contained under is preselected.

this can be seen from the url's

1, http://localhost:30320/OrchardLocal/Admin/Contents/Create/GalleryPage

2, http://localhost:30320/OrchardLocal/Admin/Contents/Create/GalleryPage?ContainerId=43&ReturnUrl=%2FOrchardLocal%2FAdmin%2FLists%2F43

Now if I create a Gallery page using 1, the autoroute does not get set correctly. It ignores the container and only uses the {Content.Slug}

If I create a gallery page using 2, the autoroute works correctly.

It appears that creating a Gallery page with the "ContainerId=43" query string results in the hidden field being populated and everything works fine <input id="CommonPart_ContainerId" name="CommonPart.ContainerId" type="hidden" value="43" />

If I use method 1 and I click publish for a second time the route is fixed as I have selected "Automatically regenerate when editing content" in the options.

I don't see this listed as a issue, surly someone else is using Lists and can verify this?

Using orchard 1.4.1

May 21, 2012 at 4:41 AM

List is deprecated.

May 21, 2012 at 4:47 AM

Is the new way to create a custom content type with a containable part?

May 21, 2012 at 10:54 AM

Since Containable and Container are not deprecated, you can attached those parts to any content types and use them.

May 21, 2012 at 11:07 AM

Yes, but going forward what will be the preferred way to create lists? It can be done with the Projector, only thing is that as far as I know you don't get the ability to nest the routes with autoroute i.e. {Content.Container}/{Content.Slug}

For now i've just used the Projector and the autoroute "gallery/{Content.Slug}"

Are Containable and Container soon to be deprecated?

May 26, 2012 at 6:26 AM

Container and Containable are not going to be deprecated any time soon. You can use Taxonomies in most cases where you were using Lists.