OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.44k stars 2.4k forks source link

Add item to or remove from List Part #3667

Open giannik opened 5 years ago

giannik commented 5 years ago

When using listPart to create a parent child relation between content items , how does one remove the relationship ?

Inside ContainedPartDisplayDriver.cs there is this code that creates the relation : if (await updater.TryUpdateModelAsync(viewModel, nameof(ListPart)) && viewModel.ContainerId != null) { model.Alter<ContainedPart>(x => x.ListContentItemId = viewModel.ContainerId); }

but how do you remove the parent child relation correctly ?

sebastienros commented 5 years ago

It could be implemented. Should we also allow to attach to a different container? I'd say probably. So listing all containers that accept this type, plus an option to detach.

giannik commented 5 years ago

Yes, that would be perfect. Thank you.

On Thu, May 23, 2019 at 11:00 PM Sébastien Ros notifications@github.com wrote:

It could be implemented. Should we also allow to attach to a different container? I'd say probably. So listing all containers that accept this type, plus an option to detach.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OrchardCMS/OrchardCore/issues/3667?email_source=notifications&email_token=AALSLNIEDNN22IYBTEKQSS3PW3ZV5A5CNFSM4HN7A4V2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWDKNVQ#issuecomment-495363798, or mute the thread https://github.com/notifications/unsubscribe-auth/AALSLNML7SXXN3LSTJ6OWXDPW3ZV5ANCNFSM4HN7A4VQ .

deanmarcussen commented 5 years ago

See also https://github.com/OrchardCMS/OrchardCore/issues/2355 regarding add (or move really) existing content to list.

Detach is also a good option, but problematic if the child items aren't listable, as when detached they maybe be lost to the admin. So perhaps detach is disabled if child item is not listable?

Piedone commented 6 months ago

Let's track the functionality of adding an item to a List Part here too. So, duplicated by https://github.com/OrchardCMS/OrchardCore/issues/5750.