sitecore

WebMethod not accessible in Sitecore

心不动则不痛 提交于 2019-12-14 02:17:03
问题 I got a problem for a website I was working on. A WebMethod is called from a JavaScript function: var ajaxOptions = { url: "/layouts/foobar/Foo.aspx/GetBar" } $.ajax(ajaxOptions).done(function(result) { loadResult(result, a); }); The method GetBar in Foo.Aspx looks like this: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public static object GetBar() { return FoobarManager.GetItems(); } The function returns a valid JSON object. Sitecore is used in the FoobarManager. Example

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.

Content does not reflect on CD server after publishing from CM server

China☆狼群 提交于 2019-12-13 21:32:59
问题 When a content is published from Content Management server to Content Delivery server, the publishing activity is inconsistent, i.e., sometimes the content reflects on CD server in couple of minutes or takes a whole day. The only scenario where the content reflects immediately on CD server is by restarting the application pool, but this is not the best practice as content editing can be frequent and every time restarting the app pool may crash the application. Please suggest what other

Running Sitecore Production Site under a Virtual Directory

血红的双手。 提交于 2019-12-13 20:41:50
问题 We are using Sitecore 6 on a Windows Server 2003 (32bit) dev machine. I know it's not recommended for the CMS editing site, but we've been told it is possible to get the front-end Sitecore websites to run from within a virtual directory. Here's the issue: we'd like to achieve what the below poor mans diagram shows. We have a website (.net 1.1) /WebSiteRoot (.net 1.1) | | |---- Custom .net 1.1 Web Application | |---- SiteCore frontend WebApplication (.net 2.0) | |---- Custom .net 2.0

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 =

How can I get the Advanced Database Crawler to index the item name

微笑、不失礼 提交于 2019-12-13 20:07:26
问题 I'm trying to switch my Sitecore application's search from the "old" indexes (Sitecore.Data.Indexing) to the "new" indexes (Sitecore.Search). I used to have an index that explicitly listed the fields that I wanted indexed. The Item's name was one of these: <field target="name">@name</field> The new indexes, along with the Advanced Database Crawler allow you to have include fields and exclude fields. I've set the index IncludeAllFields value to false, as there are more fields I want to leave

How to use jquery ajax and webmethod with sitecore

半腔热情 提交于 2019-12-13 18:56:18
问题 I'm running Sitecore 6.4 and trying to get some data using ajax and webmethod in Sitecore. Everything is in a sublayout (user control) This is the code that calls the webmethod: $("#NextBanner").click(function () { $.ajax({ type: "POST", url: "/GetNext", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { alert('success'); }, error: function (err) { alert('error'); } }); This is the webmethod, returns a string: [WebMethod] public static

IIS 7.5 404 Error for .PDF files

情到浓时终转凉″ 提交于 2019-12-13 16:31:40
问题 I am running into an issue where I am re-directing a .pdf extension url using IIS 7.5. Here is what is weird happening: When my URL does not contains .pdf in it like: http://mySite/documents/forms/test the pdf (test.pdf) opens up perfectly. However, when I am opening through like this: http://mySite/documents/forms/test.pdf it is showing me HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. I browse through

Customising the Quick Info Section in the Content Editor of Sitecore

℡╲_俬逩灬. 提交于 2019-12-13 14:39:55
问题 Is it possible to customise the quick info section in the content editor to show additional information about the item? Thanks 回答1: I think this would be quite tricky. If you look at Sitecore.Shell.Applications.ContentManager.Editor (in Sitecore.Client.dll), you'll see there is a RenderQuickInfo method. The HTML gets pieced together manually and is added to an EditorFormatter object as a literal control. All the classes involved are tightly integrated in to the application - there's no easily