@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@umbraco.NodeFactory を使用します。@umbraco.MacroEngines を使用します。
<ul class="rslides">
@{
var rootNode = Model.Content.AncestorOrSelf(1);
var items = (rootNode.HasValue("featuredSlides")) ? (Umbraco.Core.Dynamics.DynamicXml)rootNode.GetPropertyValue("featuredSlides") : null;
}
@if (items != null)
{
foreach(var item in items)
{
int id = Convert.ToInt32(@item.InnerText);
Node node = new Node(id);
var mediaItem = Umbraco.TypedMedia(node.GetProperty("picture").ToString());
int mediaHeight = Convert.ToInt16(@mediaItem.GetPropertyValue("umbracoHeight"));
int maxHeight = 700;
int height = (mediaHeight > maxHeight) ? maxHeight : mediaHeight;
var url = @node.Url;
<li><a href="@Umbraco.NiceUrl(id)"><img src="/imagegen.ashx?image=@mediaItem.GetPropertyValue("umbracoFile")&width=640"></a></li>
}
}
</ul>
@node の公開状況を知りたいです。私はumbraco 6.1.6で作業しています
私はすでにvar p = @node.GetProperty("published")
(publishedCount, publishedStatus ...) のようなものを試しましたが、何もうまくいきませんでした。
何か案が?
ありがとう。