sitecore

Creating big amount of Sitecore Items causes memory leak

人走茶凉 提交于 2019-12-03 14:31:07
I have a Sitecore application where I need to create a large number of Sitecore items in a loop from another system. Below is my testing purpose loop; using (new Sitecore.SecurityModel.SecurityDisabler()) { for (int i = 0; i < 20000; i++) { Item newItem = MyTemplateItem.CreateItemFrom(DateTime.Now.Ticks.ToString(), myParentItem); newItem.Editing.BeginEdit(); newItem.Fields["Title"].Value = Guid.NewGuid().ToString(); newItem.Editing.EndEdit(); } } When this loop is running and while looking in task manager, the process memory usage is getting increased with the time. Sitecore Item class has not

How to flag new items as unpublished items?

喜你入骨 提交于 2019-12-03 14:18:40
In sitecore, if I add a new item to the master database(Unpublished), it does not show any indication regarding the published state. For an example, if a user has added 10 items, he might get confused to figureout the items added by him which are pending for publishing. Is there a way to identify newly added items as unpublished or in new and display a validation in the "Quick action bar"? Ruud van Falier Never thought about this, but it's actually pretty easy to fix. I created a GutterRenderer that indicates wether an item has been published to at least one, to all, or to none of the

Why does Sitecore publish draft items from the C# API, and how do I stop it doing so?

纵饮孤独 提交于 2019-12-03 12:44:24
I'm running a scheduled publish of my Sitecore master DB using the Sitecore publishing API. I call a web service at scheduled intervals during the day which runs the following code (slightly condensed for readability): // grab the root content node from sitecore Item contentNode = dbSource.Items[ID.Parse("{0DE95AE4-41AB-4D01-9EB0-67441B7C2450}")]; PublishOptions options = new PublishOptions(sourceDatabase, targetDatabase, PublishMode.Smart, lang, DateTime.Now); options.RootItem = contentNode; options.Deep = true; Publisher p = new Publisher(options); p.PublishAsync(); When we run the above

Sitecore: How to access same field name in different sections

别来无恙 提交于 2019-12-03 12:13:39
I have data template dt1 in sitecore that has the field "header" in section "data". I also have data template dt2 that has the field "header" in section "portal" Finally I have data template dt3 that uses both dt1 and dt2 as base templates. How can I, in xslt, find the content of portal/header? In my code, when I write <sc:text field="header" />, I get the content of data/header (since this node comes first). I know how to do this in .net, but I need to use xslt. /callprat You can't. And frankly I don't know of any supported way to do it from .NET either. This, straight out of the Data

What are the pros for using extension-less URLs?

安稳与你 提交于 2019-12-03 10:47:34
What are the pros for using extension-less URLs? For example, why should I change... http://yoursite.com/mypage.html http://yoursite.com/mypage.php http://yoursite.com/mypage.aspx to... http://yoursite.com/mypage And is it possible to have extension-less URLs for every page? Update: Are extension-less URLs better for site security? JKG The reason for extension-less URLs is that it is technology independent. If you want to change how your content is rendered you do not have to change the URL. W3: Cool URIs don't change File name extension This is a very common one. "cgi", even ".html" is

Accessing Sitecore API from a CLI tool

我只是一个虾纸丫 提交于 2019-12-03 09:19:53
I would like to access the Sitecore API from within a command line tool (with a goal of exporting some information about users in the database), however I haven't been able to get a simple CLI program connected. To give a simple example using Sitecore; using Sitecore.Configuration; using Sitecore.Data; using Sitecore.Data.Items; ... static void Main(string[] args) { Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master"); Console.WriteLine(master.Items.ToString()); } As this currently stands, I get the following exception Unhandled Exception: System

Avoid removal of current Lucene.NET index during rebuild

廉价感情. 提交于 2019-12-03 09:19:21
问题 I'm new to Lucene.NET but I'm using an open source tool built for Sitecore CMS that uses Lucene.NET to index lots of content from the CMS. I confirmed yesterday that when I rebuild my indexes, the current index files wipe clean so anything that relies on the index gets no data for about 30-60 seconds (the amount of time for a full index rebuild). Is there a best practice or way to make Lucene.NET not overwrite the current index files until the new index is completely rebuilt? I'm basically

Webforms for marketers form fields conditional visibility dynamically

六月ゝ 毕业季﹏ 提交于 2019-12-03 08:55:25
We are using WFFM for our landing pages creation. It is very easy for our marketing guys to use that. Now, we are looking at customizing them. For instance, we have the following requirement. On our form, we display country of residence, but when you select some countries, we want to display one more dropdown called state/province with the states. When user selects other countries, we have to hide the state/provice field. I am banging my head, how can I start implementing this. Can anyone of you guide me, how to proceed? Try the following: Create a DropList field on your form in Sitecore Add

How to perform search for multiple terms in Sitecore 7 ContentSearch API?

♀尐吖头ヾ 提交于 2019-12-03 07:50:16
I am exploring the new Sitecore.ContentSearch "LINQ to Sitecore" API in Sitecore 7. It is my understanding that Sitecore recommends using the new LINQ API over the existing Sitecore.Search API, however, I am struggling to perform even the simplest of queries. Take for instance the following search query: "hello world" . Using the Sitecore.Search API, the terms "hello world" would typically be passed through a QueryParser which would result in documents matching the word "hello" OR "world". Documents containing both terms would be scored higher that those with just one. How does one perform

How to remove broken links in Sitecore

放肆的年华 提交于 2019-12-03 06:58:34
We've got a Sitecore site where several items have broken links to an old workflow state that is no longer with us. I know that you can remove links when you delete an item, but I'm not seeing an interface to simple remove a broken link on an item, when the missing item is already gone. What's the best way to remove broken links in this case? Thanks. There is Sitecore admin page that allows removing broken links. You can find it here: http://localhost/sitecore/admin/RemoveBrokenLinks.aspx You just select the database and execute the action. You can also serialize all items changed during this