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

The href of ContentLinkTagHelper is none when customizing list page include two kind of content type. #16042

Closed
effapp opened this issue May 13, 2024 · 3 comments
Labels
Milestone

Comments

@effapp
Copy link

effapp commented May 13, 2024

Describe the bug

The href of ContentLinkTagHelper is none when customizing list page include two kind of content type.

To Reproduce

Steps to reproduce the behavior:

  1. Create a query of contentItem include two kind of content type
  2. Create two customizing .Summary.cshtml, code snippet as follow:
    // Content-contentType1.Summary.cshtml and Content-contentType1.Summary.cshtml is same
@inject IContentItemDisplayManager _contentItemDisplayManager
@using OrchardCore.ContentManagement
@using OrchardCore.ContentManagement.Display
@using OrchardCore.Media.Processing
@using OrchardCore.Mvc.Utilities
@{
    var titleText = Model.ContentItem.DisplayText;
}

    <a display-for="@Model.ContentItem" aria-current="true">
        <span>@titleText</span>
    </a>

  1. The list page nomally render list of link
  2. The href of link from contentType1 is nomal
  3. The href of link from contentType2 is none
@effapp
Copy link
Author

effapp commented May 14, 2024

OrchardCore version : 1.8.3
ContentType1 render result:
image
ContentType2 render result:
image

@sebastienros
Copy link
Member

Looks like the tag helper is not rendered which is usually because the tag helper namespace is not imported. However it works in the first view. Are the two views in the same folder such that the _ViewStart works for both (and imports the tag helper)?

@sebastienros sebastienros added this to the 2.x milestone May 16, 2024
@effapp
Copy link
Author

effapp commented May 17, 2024

The two views aren't in the same folder. It works after importing the tag helper in _ViewStart of second views.
Thanks.

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

No branches or pull requests

3 participants