English 中文(简体)
umbraco - 用户控制 - umbracoNaviHide
原标题:umbraco - usercontrols - umbracoNaviHide
  • 时间:2011-05-16 22:53:18
  •  标签:
  • umbraco

我知道,我可以拿到现在的 no子——Node.GetCurrent();但我似乎可以找到什么地方来获得相关的财产,特别是眼镜。 我很想知道,如何在用户控制下获得从甚低频发射机可获取的相同数据。

最佳回答

To get properties you need to use the GetProperty() method.

var top = Node.GetCurrent(); top.GetProperty("umbracoNaviHide").Value;

问题回答

在乌布拉科8,你必须做这样的事情:

    private List<NavigationListItem> GetChildNavigationList(IPublishedContent page)
    {
        List<NavigationListItem> listItems = null;
        var childPages = page.Children.Where(i => i.IsPublished());

        if (childPages != null && childPages.Any() && childPages.Count() > 0)
        {
            listItems = new List<NavigationListItem>();
            foreach (var childPage in childPages)
            {
                int myTrueFalseFieldValue = 1;
                if (childPage.HasProperty("umbracoNaviHide"))
                {
                    Int32.TryParse(childPage.GetProperty("umbracoNaviHide").GetValue().ToString(), out myTrueFalseFieldValue);
                    //myTrueFalseFieldValue = 0 // hide the page
                    //myTrueFalseFieldValue = 1 // don t hide the page
                    string name = childPage.Name;
                    int test = myTrueFalseFieldValue;
                }

                if (myTrueFalseFieldValue == 1)
                {
                    NavigationListItem listItem = new NavigationListItem(new NavigationLink(childPage.Url, childPage.Name));
                    listItem.Items = GetChildNavigationList(childPage);
                    listItems.Add(listItem);
                }
            }
        }
        return listItems;
    }

高于代码后,将确保那些已经设置了库布拉语的网页。 真正的纳希德检查箱财产将不列入导航清单。

为了了解如何使习惯财产化:mbracoNaviHide,请在“Day11:Umbraco导航中的Hide pagess”上查询。





相关问题
Creating custom content sections with umbraco

I m working on an umbraco website just now and one of the requirements is to have a custom section in the back end that can be used to manage publish smaller micro-sites. I have been able to create ...

MVC and Umbraco integration

I ve followed the steps from http://memoryleak.me.uk/2009/04/umbraco-and-aspnet-mvc.html and integrated MVC in Umbraco with success, but I still have a problem which is critical for me. Is there any ...

Umbraco server error after install

I downloaded umbraco and used the web platform installer. Everything went though okay and it installed SQL Express 2008 and a new directory under the default website in IIS. However when I launch the ...

XSLT, sort and group by year-date

Regarding Umbraco XSLT version 1. I have aprox. 150 news items in XML. Lets say like this (all is pseudocode until I get more familiar with this xml/xslt): <news> <data alias=date>2008-...

Open node in Umbraco programmatically

I have created a dashboard for an Umbraco site and I want to link from it to various node in the tree. From what I can tell Umbraco uses editcontent.aspx?id={thenodeid} and javascript:opencontent({...

Umbraco Back Office Membership Provider

Has anyone had any experience trying to write a custom Membership Provider for the Umbraco back office? I ve run into all sorts of trouble trying to make this happen. You can see some more details ...

热门标签