Orchard CMS查询原始布局级别对属性的访问 [英] Orchard CMS Query Raw Layout Level Access To Properties

查看:96
本文介绍了Orchard CMS查询原始布局级别对属性的访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是因为我不知道替换令牌的工作方式.另一个示例问题是在编辑布局"上的一个级别,我想将项目类设置为工作项{Category},类别是我用于分组的属性的名称/标题.

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.

在投影的正上方:我想包含一些ul中列出所有类别的html,即data-filter =.experiential"我尝试过类似的工作:工作项{Category}和工作项{Content. Fields.CaseStudy.Category}.类别是分类法中的一个术语"(?).

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.

推荐答案

尝试一下:

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

分类法字段具有术语集合,因此,如果该字段配置为允许,则需要首先访问该字段的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.

这篇关于Orchard CMS查询原始布局级别对属性的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆