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

Using the shape name convention dot and dash not working for edit alternates. #7952

Closed
giannik opened this issue Dec 12, 2020 · 1 comment
Closed

Comments

@giannik
Copy link
Contributor

giannik commented Dec 12, 2020

Trying to add some edit part alternates to customize the layout of my part using the following code

        builder.Describe("ContentPart_Edit")
                .OnDisplaying(displaying => 
                {
                    dynamic shape = displaying.Shape;
                    if (shape.ContentTypePartDefinition != null)
                    {
                        string contentPartName = shape.ContentTypePartDefinition.Name;
                        displaying.Shape.Metadata.Alternates.Add($"ContentPart_Edit__{contentPartName}");
                    }
                }); 
				

But when adding a file named MyPart-ContentPart.Edit.cshtml in the admin theme its not getting picked up.

If I remove the dash convention in the name of shape as follows :

 displaying.Shape.Metadata.Alternates.Add($"{contentPartName}ContentPart_Edit");

and add the file

MyPartContentPart.Edit.cshtml

then it works.

So, is this intended or has something broke ?

The part has been created from the admin , not a strongly typed class.

@giannik giannik mentioned this issue Dec 13, 2020
3 tasks
@giannik
Copy link
Contributor Author

giannik commented Dec 19, 2020

same issue as was fixed here #7086

@giannik giannik closed this as completed Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant