问题
I am looking into using Orchard CMS for an upcoming project and have hit a block. The site need to display articles of various types alongside a list of recent articles of the same type.
To that end I have:
- Created a custom ContentType called Article which includes a TaxonomyField for ArticleType.
- Created a custom theme with zones to reproduce the layout the customer requires. (Including RecentArticles.)
- Created a custom widget layer to show/hide the RecentArticles zone based on the current ContentType. (I.e. the RecentArticles zone is only populated when we are displaying an Article.)
- Created a Projection to show recent content of type Article.
I see that I can use the ArticleType taxonomy field to filter the source of the underlying query of part 4. However I need that filtering to be dynamic based on the ArticleType of the currently displaying content.
Is this possible? Is there an alternative way to reach the same result?
Thanks in advance.
来源:https://stackoverflow.com/questions/26261689/orchard-cms-dynamic-query-based-on-taxonomyfield-of-current-content