2012-03-04 136 views
0

我想在我的首页(Home)umbraco网站上创建新闻栏目。 我的想法是从网站的内容除了保持新闻内容类似这样的文件夹中:如何从Umbraco中的当前其他网站获取内容?

  • 首页

    • 第2页
    • 第3页
  • 新闻

    • 个新闻第1项
    • 新闻项目2

但如何我能得到这个消息的内容为我(主页),当它不是在同一文件夹?

请帮忙。

+0

什么一把umbraco的版本? – 2012-03-04 16:18:09

回答

2

如果您使用XSLT然后你可以这样做:

<xsl:for-each select="$currentPage/ancestor-or-self::root/News/NewsItem"> 
    <!-- do whatever here --> 
</xsl:for-each> 

如果你正在做的剃刀语法,然后使用:

@foreach (var newsitem in Library.NodeById(-1).Descendants("News").ChildrenAsList) { 
    // Your processing/rendering code in here 
}