Skip to content
This repository was archived by the owner on Dec 22, 2025. It is now read-only.
This repository was archived by the owner on Dec 22, 2025. It is now read-only.

Which friend can help me? How to use this feature correctly? #23

@uussoft

Description

@uussoft

when i add this code in the liquid template like this:
`{% if Model.ContentItem | user_can_view %}

Awesome content that you have permission to view.


{% else %}

Unfortunately you're not able to view this content.


{% endif %}

{{ Model.Content.ContentsMetadata | shape_render }}
{{ Model.Content.MarkdownBodyPart | shape_render }}
{{ Model.Content.BlogPost-Category | shape_render }}
{{ Model.Content.BlogPost-Tags | shape_render }}
{{ Model.Content.CommentatorPart | shape_render }}`

run the app,throw this exception:

An unhandled exception occurred while processing the request. Exception: Failed to parse liquid file /Areas/TheBlogTheme/Views/Content-BlogPost.liquid: Invalid 'if' tag at (31:6) Source: {% if Model.ContentItem | user_can_view %} OrchardCore.DisplayManagement.Liquid.LiquidViewTemplate+<>c__DisplayClass8_0+<<ParseAsync>b__0>d.MoveNext() in LiquidViewTemplate.cs, line 98

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions