Ejemplo n.º 1
0
        protected void rptSearchResults_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                SearchHit <SitecoreItem> item = (SearchHit <SitecoreItem>)e.Item.DataItem;
                {
                    HyperLink ItemLink        = (HyperLink)e.Item.FindControl("ItemLink");
                    Literal   ItemDescription = (Literal)e.Item.FindControl("ItemDescription");

                    if (ItemLink != null && ItemDescription != null)
                    {
                        Item i = item.Document.GetItem();
                        ItemLink.NavigateUrl = LinkManager.GetItemUrl(i);
                        if (i["menu title"] != string.Empty)
                        {
                            ItemLink.Text = i["menu title"];
                        }
                        else if (i["title"] != string.Empty)
                        {
                            ItemLink.Text = i["title"];
                        }
                        else
                        {
                            ItemLink.Text = i.Name;
                        }

                        ItemDescription.Text = SiteConfiguration.GetPageDescripton(i);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public string MetaTags()
 {
     // http://www.seomoz.org/blog/the-wonderful-world-of-seo-metatags
     return(String.Format("<meta name=\"title\" content=\"{0}\" /><meta name=\"description\" content=\"{1}\" />", Sitecore.Context.Item["Menu Title"], SiteConfiguration.GetPageDescripton(Sitecore.Context.Item)));
 }
 public string GetDescription()
 {
     return(SiteConfiguration.GetPageDescripton(Sitecore.Context.Item));
 }