sitecore

Sitecore versioned image not loading

前提是你 提交于 2019-12-06 03:40:24
I'm running Sitecore 6.5 and have a data template that has an image field and an item that's based on that template. The site had two languages. If I use a versioned image (one item in the media library with En and Fr versions) in the En and Fr versions of the item then publish the site and switch the language in the site using query string, sc_lang=en or fr, everything changes in the page except for the image. But if I use two different images (two items in the media library) then the correct image loads when switching between languages. Any idea to why this happens? Thanks T Update I tried

Escaping reserved words

安稳与你 提交于 2019-12-06 03:26:46
Sitecore provides a way of escaping words within a Sitecore query that contain characters that they don't like. Such characters include hyphens and spaces. In the interest of simplifying my life, I wrote a simple helper function that would escape every part of a Sitecore query, and it worked fine for a while: public static string EscapePath(string path){ return Regex.Replace(path, @"([^/]+)", "#$1#").Replace("#*#", "*"); } (the Replace("#*#","*") is in there because Sitecore doesn't like it when you wrap the asterisk in hashes). As I said, this worked fine for a while. Today, I came across a

Sitecore, custom MVC controllers and routes

北战南征 提交于 2019-12-06 02:48:01
I have a website defined in Sitecore's site definitions. The path to it is /localhost/mysite/home . And it works. I need to create a custom controller to submit forms with an API bypassing Sitecore. So I have FormsController (inheriting from MVC controller) with an action named "Test" taking no parameters. I defined the route in the initialize pipeline like this: public class Initialize { public void Process(PipelineArgs args) { MapRoutes(); GlassMapperSc.Start(); } private void MapRoutes() { RouteTable.Routes.MapRoute( "Forms.Test", "forms/test", new { controller = "FormsController", action =

How to provide email notifications/workflows for clones

六眼飞鱼酱① 提交于 2019-12-06 02:21:32
We want to set up a system where administrators of clones receive email notification when the item their clone was cloned from is updated. There will be multiple clones created from this item and ideally we'd like to filter notification by language (so administrators of an English clone don't receive notifications when the French version is updated). Is there a simple way to implement any of this inside a workflow? If so, which even should I try and hook a workflow action to? Will I need to extend or override a pipeline to do this? Crossposted to SDN http://sdn.sitecore.net/forum/ShowPost.aspx

Has anyone run into Sitecore removing JavaScript from the page editor?

时光怂恿深爱的人放手 提交于 2019-12-06 01:35:43
问题 I've been working on a custom page in Sitecore over the holidays, and I've noticed an issue where Sitecore removes JavaScript lines from the editor. Here's an overview of my current scenario: I add Javascript to the page. I save, check in, and publish. Changes are there, and everything is working. I work on it later and those changes are no longer there. I'm the only one who's edited this page, and it is publishing the current/correct version. It doesn't matter if I add the script through the

jQuery update of asp:HiddenField fails to be persisted across postback

心不动则不痛 提交于 2019-12-06 01:13:57
I have a sublayout in sitecore (which is an ascx control) which contains a hidden field and an image map. Depending on the area of the image map which is clicked, I want to set the value of the hidden field, then initiate a postback to the server. My markup is as follows: <script type="text/javascript"> function SetRegion(regionName) { $('#<%=hdnRegion.ClientID%>').val(regionName); __doPostBack('<%=lnkRedirectButton.UniqueID%>', ''); } </script> <img src="/Images/Interface/Map-Background.png" usemap="#regionMapView" class="map" /> <map id="regionMapView" name="regionMapView"> <area id="x" href

Sitecore CustomValidator does not fire on WFFM custom field

风流意气都作罢 提交于 2019-12-06 00:19:32
I've try to extend SingleLineText field on WFFM on Sitecore. This field will have CustomValidator. But ServerValidate event does not fire when page postbacked. The snipped code below. public class SingleLineText : Sitecore.Form.Web.UI.Controls.SingleLineText { protected override void OnInit(EventArgs e) { base.OnInit(e); var validator = new CustomValidator() { Display = ValidatorDisplay.None }; validator.ServerValidate += this.Validator_ServerValidate; this.generalPanel.Controls.Add(validator); } protected void Validator_ServerValidate(object source, ServerValidateEventArgs args) { // does not

Sitecore - Multiple-Site Error Page Handling

陌路散爱 提交于 2019-12-06 00:03:18
I have a multiple-site Sitecore project. I know how to deal with error pages via the webconfig's ErrorPage, ItemNotFoundUrl, LayoutNotFoundUrl, LinkItemNotFoundUrl for one site. However, I'm wanting to display a different error pages for each site. How can I accomplish this? John West In any case, you can probably store the URLs of the error pages for each site as attributes of the /configuration/sitecore/sites/site elements in web.config by extending the Sitecore.Sites.SiteContext class ( see for information about extending existing classes ). The SDN forum post provides more information

How to solve a login/database missing error regarding Sitecore Training Website?

对着背影说爱祢 提交于 2019-12-06 00:02:57
I get the following error while accessing the Sitecore Training Website. Server Error in '/' Application. Cannot open database "SiteCoreTrainingSitecore_Core" requested by the login. The login failed. Login failed for user 'sitecore'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Cannot open database "SiteCoreTrainingSitecore_Core" requested by the login. The login failed. Login failed for

Lucene Indexes in Sitecore getting corrupted (ArgumentOutOfRangeException)

谁都会走 提交于 2019-12-06 00:01:14
We are having an issue with searching a Lucene Index in Sitecore. Everything works fine for a while, and then, after what appears to be a random amount of time, we start getting the following error on every single search against the index: System.ArgumentOutOfRangeException Message: Non-negative number required. Parameter name: capacity Source: mscorlib at System.Collections.Hashtable..ctor(Int32 capacity, Single loadFactor) at System.Collections.Hashtable.Clone() at SupportClass.WeakHashTable.Clean() at SupportClass.WeakHashTable.CleanIfNeeded() at SupportClass.WeakHashTable.Add(Object key,