Orchard CMS Query Raw Layout Level Access To Properties

人盡茶涼 提交于 2019-12-13 05:43:07

问题


I think this is because I don't know how replacement tokens work. Another example problem is up one level on the edit Layout, I want to set the item class to work-item {Category}, Category being the name/title of a property, which I am using for grouping.

Right above the projection: I want to include some html that lists all the Categorys in a ul i.e. data-filter=".experiential" I have tried things like: work-item {Category} and work-item {Content.Fields.CaseStudy.Category}. Category is a "term" (?) from a taxonomy.


回答1:


Try this:

{Content.Fields.CaseStudy.Category.Terms:0}

A taxonomy field has a collection of terms, so you need to first access the Terms property of the field, then specify which one you want (the first one in the example above), if the field is configured to allow for multiple values. If it's configured for a single value, you may get away with removing the :0 at the end as this will concatenate the values into a comma-separated list, but since you have only one, that will be equivalent.



来源:https://stackoverflow.com/questions/40250304/orchard-cms-query-raw-layout-level-access-to-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!