sitecore

Auto Increment / Identity Custom Field Type

[亡魂溺海] 提交于 2019-12-06 15:59:43
I am currently implementing a system where there are user generated items, we can call them Orders. I would like to have a field (non-GUID) that is easy for customers to say over the phone or to write down that represents their order. The field should be simple and unique which made me think of an identity field. Can a portion of the item's GUID, say 10 characters, be unique enough? How can a unique field like this be implemented in Sitecore? GUIDs are alpha-numeric which is fine for my situation, but are too long. Currently I am doing so an example could be 103143317 (Store 103, at 2:33.17pm)

How can I get Sitecore Field Renderer to use a css class for an image

[亡魂溺海] 提交于 2019-12-06 15:33:42
Using Sitecore (7) & MVC, I'd like to know how to add a css class attribute for an image to the field renderer in sitecore. Without Sitecore it looks like this: <div class="background-container"> <img src="/images/background-1.jpg" class="background"> </div> With Sitecore: <div class="background-container"> @Html.Sitecore().Field(Constants.Fields.HomeBackgroundImage) </div> There doesn't seem to be a way to add the class background to the image itself in Sitecore. Is there another way to do this? Thanks. Benutzer This was what I was looking for: @Html.Sitecore().Field("MyFieldName", myItem,

Sitecore - 2 Media items. Same filename, different extensions

大兔子大兔子 提交于 2019-12-06 14:51:44
If you have 2 media items that have the same name but different extensions, Sitecore cannot differentiate between them. For example: /~/media/myfile. pdf /~/media/myfile. doc When these URL's are requested, the PDF file is returned in both cases. I understand that that Sitecore ignores the extension in the request, and that the real problem is in fact, that I essentially have two items with the same path in the media library: sitecore/media library/myfile However, I do think it's a reasonable that our customer would want to store both PDF and DOC versions of the same document in a single node.

How to maintain Lucene index availability during rebuild?

冷暖自知 提交于 2019-12-06 14:21:38
When rebuilding indexes on a content delivery server, any components that search that index fail (blow up). How can I rebuild my index without causing the search components to be unavailable? Furthermore, is there a standard way to handle this? The code I'm using to perform the reindex on regular intervals: Sitecore.Data.Database db = Sitecore.Configuration.Factory.GetDatabase(DBName); Index index = db.Indexes[IndexName]; index.GetSearcher(db).Close(); index.Rebuild(db); To give a little context: Sitecore version - 6.4.1 (rev. 110324) It is necessary to rebuild the index because it contains

Sitecore 6.5 DMS - Registering a goal completion via the API

假装没事ソ 提交于 2019-12-06 13:47:42
I want to register a goal/conversion on my Sitecore 6.5 site using the API rather than a 'thank-you' page. I've seen this question about how to do it Sitecore OMS - achieving a goal on a form submission but the answer relates to the API prior to Sitecore 6.5 where it was overhauled quite significantly. Has anyone done this? Or has this functionality been intentionally removed? Jens Mikkelsen Have you tried something like protected void btnSubmit_Click(object sender, EventArgs e) { if (Sitecore.Analytics.Tracker.IsActive && Sitecore.Analytics.Tracker.CurrentPage != null) { PageEventData

Is it possible to stop Sitecore from performing a publish operation?

一个人想着一个人 提交于 2019-12-06 12:57:09
If I click "publish" on my entire content tree in the Sitecore Desktop, I will get the dialogue telling me how many items have been processed. Sometimes I know that this operation is going to take an extremely long time (e.g. an hour). There's no way to stop this process. Of course I can close the dialogue and continue using Sitecore, but the publish is still ongoing in the background. I cannot publish anything else until it has completed. Recycling the app pool will kill the publish, but it is very disruptive to users working within Sitecore. Is it possible to programatically, or otherwise,

Sitecore Controller Rendering DataSource

爷,独闯天下 提交于 2019-12-06 11:26:02
I have a component in Sitecore that can be used in the middle section of the page. It shows a video and is setup as a controller rendering in Sitecore. I have been able to get this to work by setting the DataSource on the rendering on the page item. I have another component for the middle section of the page. This is a list of videos. Each video output has the exact same HTML as the rendering mentioned in the previous paragraph. I'm trying to call the controller rendering (mentioned above) in the rendering for this list rendering something like this - @Html.Sitecore().Controller(

How to exclude fields form being indexed with Sitecore search (new method)

社会主义新天地 提交于 2019-12-06 11:04:19
How can I specify wich fields to index with lucene indexing with Sitecore (new method) ? For example i'd like to index only the fields 'title' and 'text'. There seems to be a IndexAllField parameter that can be set to False but how can I set wich fields needs to be indexed ? I'm using Sitecore.Search.Crawlers.DatabaseCrawler. Thank you Are you using the Advanced Database Crawler ? If so, there are sections you can add to include specific fields by their GUIDs and exclude specific fields by their GUIDs. Below I've provided a snippet where the hint attribute of the <include> node defines whether

Get number of components in placeholder, Sitecore

眉间皱痕 提交于 2019-12-06 10:01:39
问题 I have a component that needs to know how many components thats currently added to the very same placeholder, this since it needs to update a value of an html-attribute based on its index within the placeholder. Is there anyway to get either the number of components thats already added to a placeholder, or to get the current-renderers index? Usually I would just use a simple for-loop and set the attribute, but since its a placeholder with components thats not an option. Thanks in advance! 回答1

Multivariate Testing for Sublayouts in Sitecore

不问归期 提交于 2019-12-06 10:01:06
Having toyed with the concept in the past, I am interested in using multivariate testing on my companies Sitecore website. There are a number of places where I feel we can definitely improve sales through the use of A/B testing in: Running two entirely different templates to see what layouts work better for users Running a number of different Sublayouts (forms) on the site to see which ones people are more likely to fill out Trialling different content - Running two different sets of copy to see if users are more likely to stay on the page I want to use the Marketing Suite within Sitecore, and