2017-06-13 166 views

回答

0

的标签应该只是在当前页的属性?例如

CurrentPage.tagsPropertyName.ToString().Split(','); 

我会使用强类型的东西,虽然,因为这是一个有点易于阅读,不容易比动态的东西怪异的转换错误。

Model.Content.GetPropertyValue<string>("tagsPropertyName").Split(','); 

你甚至可以写一个特性转换器,使这一切有点整洁:http://www.theoutfield.co.uk/blog/2013/04/strongly-typed-property-values-using-property-editor-value-converters-in-umbraco

0

你应该能够使用得到您的网页标签的下面:

var tagList = Umbraco.TagQuery.GetTagsForEntity(CurrentPage.Id);