sitecore7

Can I programmatically find a Sitecore item's parent matching a certain template id?

烂漫一生 提交于 2019-12-13 05:47:12
问题 I have a custom Sitecore command that I would like to expand upon to determine if the current item has a parent item matching a certain template id. When the command/button is clicked, I will have access to the current Item . My initial attempt, since I had issues with escaping the FullPath for use in a query, was to loop through the parent item (and then that item's parent, etcetera) to determine if any matched the template. However, there seems like there should be a better way to do this.

Visual Studio taking long time to build and load solution because of Nugget

余生长醉 提交于 2019-12-13 05:14:39
问题 Visual studio is taking a longer time to open the solution ,to build and I just have 6 projects.When I examined the fiddler I see below requests to nugget and notice that once this request is complete the visual studio becomes responsive. Can any body suggest the below: what are these requests for nugget? Is VS becoming slow because of this as I am suspecting? How to stop these requests? 回答1: These requests can be a result of your solution enabling automatically restoring NuGet packages, You

Sitecore - Custom field, add unique value on create [closed]

守給你的承諾、 提交于 2019-12-13 05:14:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I want to create a field that generates a running number. This number will be automatically generated everytime I create a new item and has to be unique. Any examples of how this could be implemented? I don't want to use the Sitecore item ID for this. 回答1: You can implement a custom token and just use your field

Using Glass Mapper's @inherits GlassView<T> with MVC 5.0 views

淺唱寂寞╮ 提交于 2019-12-13 05:09:09
问题 I recently updated my solution to MVC 5 and I am facing the following issue. It appears as though I can no longer format the code in any of my Views that utilize @inherits GlassView<T> . By format, I mean auto-formatting using the CTRL + K + D key combination. When I press the format combination, the namespace and class name get lowercased and all references to Model appear to break. This only occurs on GlassViews... traditional Views using a @model declaration appear to be unaffected. Any

Limit number of Characters entered for Link Title Field in General Link

一世执手 提交于 2019-12-11 21:27:31
问题 Can we limit number of characters that a content author can enter in the Link Title Field for general link for both Internal and External Link as shown below Thanks in Advance, 回答1: I have yet to find a way to set this per template-field but I managed to add a MaxLength on the input in this file: sitecore\shell\Applications\Dialogs\ExternalLink\ExternalLink.xml <Edit ID="Title" Width="100%" MaxLength="20" /> Edit: new solution to enable per template-field maxlength I dug a bit further and

Add enclosing tag for only UnOrdered list from Rich Text Editor in UL

丶灬走出姿态 提交于 2019-12-11 21:08:08
问题 I need to style UL's coming from Rich Text Editor in Sitecore. I am trying to find out if there is a class that I can add to all UL's coming from Sitecore's Rich Text Editor. Thanks in Advance Ashok 回答1: The easiest solution is just to wrap your FieldRenderer with an HTML element with appropriate class applied in code: <div class="rich-text"> <sc:FieldRenderer ID="frRichTextField" runat="server" FieldName="MyFieldName" /> </div> And then add in some CSS styles to handle your UL's within this:

Sitecore Include Files sort order broken

老子叫甜甜 提交于 2019-12-11 13:53:52
问题 Suddenly, Lucene indexes at my Sitecore website got broken and after some investigation, I've noticed that Sitecore include files are "patching" web.config in non-alphabetical order. John West mentioned in one of hist blog posts: Sitecore processes Web.config include files in alphabetical order (technically, the order returned by the Directory.GetFiles() method). However, MSDN says: The order of the returned file names (from GetFiles()) is not guaranteed; use the Sort() method if a specific

Sitecore 7 highlight search results

感情迁移 提交于 2019-12-11 11:54:01
问题 I am working on the upgrade of a project from Sitecore 6.2 to Sitecore 7. I have found out that in Sitecore 6.2, the highlighting of the search results are implemented with the Lucene.Net.Search.Highlight.Highlighter, QueryScorer and Formatter classes in sitecore.client dll. Which classes and/or functions does Sitecore 7 provide to do highlighting in search results? I searched the web but I could not find the required information/examples. 回答1: Highlighting of results is not supported

Globally exclude cloned items from index?

我怕爱的太早我们不能终老 提交于 2019-12-11 08:35:29
问题 I am looking for an elegant way to exclude cloned items from my web index. I am having items appear as duplicates in my search results. I'd prefer it if only the original items appear and no clones at all. Some possible solutions that come to mind are to: Create a Global Item Boosting Rule to drastically lower the boost value if the item's _Source field is not empty. This is not preferred as it only lowers the score and does not remove the clones from the search results. Exclude the cloned

Sitecore glass editable cannot convert lambda expression

为君一笑 提交于 2019-12-11 04:08:42
问题 I'm using Sitecore 7.5, MVC 5.2 and Glass Mapper 3.2. When using Editable() in the renderings, the error below is shown in visual studio even though it renders properly when using the site and/or the page editor. Am I missing a reference or something? Error: "Cannot convert lambda expression to type 'System.Linq.Expressions.Expression>' because it is not a delegate type" View @using Sitecore.Mvc @using Sitecore.Mvc.Presentation @inherits Glass.Mapper.Sc.Web.Mvc.GlassView<Air.SitecoreModels