0

我正在构建一个自定义主题。我需要重写博客文章列表的呈现方式以匹配我想要的外观。我似乎无法弄清楚如何呈现博客文章的标题(或任何其他相关信息)。我所有的标记和硬编码信息都会呈现,但动态数据不会。

在我的主题文件夹“~/Views/Items/Content-BlogPost.cshtml”中:

<div class="media row-fluid">
    <div class="span1 hidden-phone">
        <!-- Date desktop -->
        <div class="date-wrapper"><span class="date-m">Jan</span> <span class="date-d">20</span> </div>
        <!-- Meta details desktop -->
        <p class="meta muted"><i class="icon-user"></i><a href="#">Alex</a> </p>
    </div>
    <!-- PROBLEM IS HERE!!!!!!!!!!! Title does not render! -->
    <div class="span11"><h1>@Display(Model.Content.Title)</h1>
        <div class="media-body">
            <div class="tags"><a href="#" class="tag">coding</a> / <a href="#" class="type">event</a></div>
            <h4 class="title media-heading"><a href="blog-post.htm">a nec in sed hac ultrices cursus</a></h4>

            <!-- Meta details mobile -->
            <ul class="inline meta muted visible-phone">
                <li><i class="icon-calendar"></i><span class="visible-desktop">Created:</span> Sun 20th Jan 2013</li>
                <li><i class="icon-user"></i><a href="#">Alex</a></li>
            </ul>
            <a href="blog-post.htm" class="media-object">
                <img src="img/blog/ape.jpg" alt="Picture of frog by Ben Fredericson">
            </a>
            <p>@Display(Model.Content)</p>
            <ul class="inline links">
                <li><a href="blog-post.htm" class="btn btn-mini"><i class="icon-circle-arrow-right"></i>Read more</a></li>
                <li><a href="blog-post.htm#comments" class="btn btn-mini"><i class="icon-comment"></i>50 Comments</a></li>
            </ul>
        </div>
    </div>
</div>
4

1 回答 1

0

感谢 Bertrand,我找到了这样做的方法。

模型.ContentItem.TitlePart.Title

于 2013-02-11T03:42:37.103 回答