sitecore7

Hide Quick info in Sitecore through code

最后都变了- 提交于 2019-12-22 12:38:33
问题 I want to hide quick info section through code instead of unchecking the check box in Application Options dialog box. Can someone help in this? 回答1: The following code does exactly what your looking for. Add this code below: namespace Custom.Framework.SC.Extensions.Pipelines { using Sitecore.Pipelines.LoggedIn; using SC = Sitecore; /// <summary>The default quick info.</summary> public class DefaultQuickInfo : SC.Pipelines.LoggedIn.LoggedInProcessor { /// <summary>The process.</summary> ///

Upgrading sitecore 6.6 index configuration to sitecore 7 (using ComputedFields)

笑着哭i 提交于 2019-12-22 05:11:56
问题 Sitecore CMS+DMS 6.6.0 rev.130404 => 7.0 rev.130424 In our project we have been using AdvancedDatabaseCrawler (ADC) for our indexes (specially because of it's dynamic fields feature). Here's a sample index configuration: <index id="GeoIndex" type="Sitecore.Search.Index, Sitecore.Kernel"> <param desc="name">$(id)</param> <param desc="folder">$(id)</param> <analyzer ref="search/analyzer" /> <locations hint="list:AddCrawler"> <web type="scSearchContrib.Crawler.Crawlers.AdvancedDatabaseCrawler,

Can I programmatically escape dashes in Sitecore queries using FullPath?

喜欢而已 提交于 2019-12-21 12:00:55
问题 I'm attempting to expand upon a custom Sitecore command to determine if the current item has a parent item matching a certain template id. I know the query should ideally be as simple as ./ancestor::*[@@templateid='{26710865-F082-4714-876B-D5E1F386792F}'] if the item is the context, or /sitecore/content/home/full/path/to/the-item/ancestor::*[@@templateid='{26710865-F082-4714-876B-D5E1F386792F}'] Unfortunately the item path includes dashes which need to be escaped like /sitecore/content/home

How do I bucket Sitecore items on something other than their creation date?

北战南征 提交于 2019-12-19 09:55:55
问题 I'm using Sitecore with DMS (Sitecore 7.2), and I'm setting up various controls on my layouts to pull content from different folders based on the users profile card. I'd like those folders to be "bucket" folders, since there'll be one folder for each profile card, and it'll be a bit unpleasant for authors to have to manually update all of these folders every time a new profile card is added. The "Developers Guide to Item Buckets and Search" says: by default, the items are organized according

Get Item in all languages in which it has a version

耗尽温柔 提交于 2019-12-19 02:54:29
问题 Say we have an Item Product(which has versions in en, jp, zh and 0 versions in ru). How can I get this item in en, jp and zh and not in ru. I tried the below code. Item tempItem = Sitecore.Context.Database.GetItem(tempID); foreach (var itemLanguage in tempItem.Languages) { //Do Something } Here tempItem.Languages is returning all four languages where I was expecting only three as ru does not have versions. Is it the correct way to achieve this? 回答1: You need to check the versioncount of the

Sitecore Glass Mapper ObjectToSwitchTo null reference in page editor

*爱你&永不变心* 提交于 2019-12-14 03:13:16
问题 I have the following structure as Template in visual studio : Under a page, i have one or more link root [SitecoreType(TemplateId = "{4AAA9A10-36C2-484F-A648-2BEF349F0052}", AutoMap = true)] public class LinkRoot : IBaseTemplate { [SitecoreChildren(InferType = true)] public virtual IEnumerable<LinkItem> Children { get; set; } [SitecoreInfo(SitecoreInfoType.TemplateId)] public virtual Guid TemplateId { get; set; } public Guid Id { get; set; } public string Language { get; set; } public ItemUri

Remove All Referrer Items in Sitecore

☆樱花仙子☆ 提交于 2019-12-14 02:32:54
问题 I have a layout item in Sitecore and I am able to identify all the referrer items via Links button. I have tons of referrer items, I would like to remove all of them. I am hoping that I won't have to go through each item individually to delete the reference items. I am also hoping not to delete the referred items and recreating it since it will generate different GUID for the new item. Is there a way to do this via Sitecore Desktop or SQL Server? 回答1: You can create a dynamic Asp.net page

Sitecore ContentSearch duplicate indexes when saving items

青春壹個敷衍的年華 提交于 2019-12-14 00:33:56
问题 I have implemented an index for our application which is supposed to index our items from an item bucket on the master database, but it seems that each time an item is updated and saved (not published, since the index works on master) an additional index is created for that item, which means another search result for the item. After regenerating the indexes there seems to be no issue, each item in the bucket is indexed exactly once. I'm adding the index config for the search functionality

Sitecore 8: Get Sublayout item when .ascx file is shared

允我心安 提交于 2019-12-13 21:37:14
问题 I have two sublayouts: Grid-1-2 and Grid-2-1. The two sublayouts are sharing a single ASCX file (not a good sitecore practice but i need it this way). The problem is that in the ASCX codebehind, i want to see if the current selected grid is Grid-1-2 or Grid-2-1 ?! I have tried using both Datasource and RenderingId techniques but to no effect. EDIT I was wondering if i can get the "Parameters" field from "Data" section of the sublayout. This would do the trick. All suggestions are welcomed.

Exclude folders from search result

孤街醉人 提交于 2019-12-13 20:32:33
问题 I am using sitecore 7 Lucene search. When I search for any term, the search results show all folders and pages. Can I exclude folders from the search result? I have following code to search documents from index. var searcher = Sitecore.ContentSearch.ContentSearchManager.GetIndex("sitecore_web_index"); using (var context = searcher.CreateSearchContext()) { var query = context.GetQueryable<SearchResultItem>(); var result = query.Where(x => (x.Content.Contains(_searchTerm)); globalResults =