Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content shape alternate targeting a specific item with ContentItemId #15572

Open
Piedone opened this issue Mar 24, 2024 · 5 comments · May be fixed by #16679
Open

Content shape alternate targeting a specific item with ContentItemId #15572

Piedone opened this issue Mar 24, 2024 · 5 comments · May be fixed by #16679

Comments

@Piedone
Copy link
Member

Piedone commented Mar 24, 2024

Is your feature request related to a problem? Please describe.

You can override the Content shape of a given content item with the Content__[Id] alternate, which is added in OrchardCore.Contents.Shapes. This is useful, but since it uses ContentItem.Id, i.e. the numeric ID of the item in the DB, it's not portable: an override will only apply with one specific DB, and if you move the content item (like import it) to another DB, it won't.

Describe the solution you'd like

Add a new alternate, Content__[ContentItemId], that uses the alphanumeric and portable ContentItem.ContentItemId. Also document it under https://docs.orchardcore.net/en/latest/docs/reference/modules/Templates/#content-templates.

We can keep the current alternate for backward compatibility, but it shouldn't really be used, so let's keep it undocumented.

Describe alternatives you've considered

Changing the existing alternate, but that would be a breaking change.

@sebastienros
Copy link
Member

We had that in orchard 1, why not.

@Piedone
Copy link
Member Author

Piedone commented May 24, 2024

Ooops, closed by mistake.

@Piedone Piedone moved this from Done to To Do in Orchard Core tracked issues May 24, 2024
@Piedone Piedone moved this from To Do to Done in Orchard Core tracked issues May 24, 2024
@Piedone Piedone reopened this May 24, 2024
@MichaelPetrinolis
Copy link
Contributor

Is this something that will be included in v2.0.0 ?

@Piedone
Copy link
Member Author

Piedone commented Aug 26, 2024

Only if you contribute it ;).

@Piedone
Copy link
Member Author

Piedone commented Sep 16, 2024

Related: #2866.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants