私はexcerpt
というテキストボックスフィールドをUmbraco 7のデフォルトのブログ投稿文書タイプに追加しました。Umbracoは、その抜粋フィールドのデータにアクセスしようとするとコンパイルエラーを報告します。デフォルトのブログ投稿文書タイプでカスタムテキストボックスフィールドにアクセスするにはどうすればよいですか?
@{
var recentblogpost = Model.Content.Site().FirstChild("BlogPostRepository").Children("BlogPost").Last();
}
@recentblogpost.Name, @recentblogpost.excerpt
@recentblogpost.Name
または@recentblogpost.Url
成功を取得:私のテンプレートで
。 @recentblogpost.excerpt
のような追加するカスタムフィールドだけが成功しません。大文字小文字の区別を@recentblogpost.Excerpt
に変更しようとしました。
報告されたエラー:
Compiler Error Message: CS1061: 'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'excerpt' and no extension method 'excerpt' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)