sitecore6

How do I turn off XHTML validation in Sitecore?

三世轮回 提交于 2019-12-19 02:23:05
问题 How do I turn off Sitecore (6.5) XHTML Validation of pages in workflow? I'm developing and keep running into issues while trying to publish down test pages because they error out. I would prefer to just get the errors as stacktraces in the browser. I'm not sure if I have changed something before this does this, but I've recently taken on a project to move a Sitecore into a multi-site solution. I did not have these issues while developing the solution the first time but I was using 6.4 instead

Annoying issue with sitecore workflows and standard value inheritance

白昼怎懂夜的黑 提交于 2019-12-18 13:09:12
问题 Right now i'm having a problem with sitecore workflow. The issue is as follows: my template standard value has set the Workflow and Default Workflow fields set. The workflow state is set to draft. However, everytime i create an item from this template it is not inheriting the workflow section fields, all of them are empty if i manually set workflow and workflow state for items, it works as expected up to the final state. However, if a content author edits the item, a new version is created

Sitecore: How to use sublayout parameters from codebehind?

拜拜、爱过 提交于 2019-12-17 21:59:33
问题 How do I get the values from the "Parameters" field (second screenshot) in the code-behind of the sublayout? I understand I can get/set parameters on a rendering (specifically sublayout) when it is added to the presentation details of an item, just as described here (Sitecore 6 - using parameters). However I would like to use the parameters field from the layout definition item. In the codebehind of the file belonging to to layout definition I can cast the parent to a sublayout and that

Sitecore: select items by field: TreelistEx

陌路散爱 提交于 2019-12-14 03:47:37
问题 I have Sitecore folder named MyItems with items of type MyItem. I need to query the items from .net code either with sitecore query or with xpath. MyItem has field MyField of type TreelistEx. I need to select all items where MyField contains 'thevalue' (guid of other item). How can i do it? Thanks a lot 回答1: string query = string.Format("/sitecore/content/MyItems/*[contains(@MyField,'{0}')]", thevalue); Item[] myItems = Sitecore.Context.Database.SelectItems(query); I just pulled this code

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

Unit Testing Sitecore using NUnit, serializing content

白昼怎懂夜的黑 提交于 2019-12-13 11:49:53
问题 In my business, I am working on Unit Testing, after finishing an example in a .NET application. We want to use a standard .NET Unit Testing project. We also want to mock the Sitecore data by serializing the Sitecore objects. I have been looking for, but could not find a good tutorial to do this. How can I do this? 回答1: Interesting videos on Youtube Sitecore Unit Testing video by gravypower. Another interesting video by codeflood. Most knowledgeable for me was this video by Alistair Deneys

Get rendering parameters when multiple sublayouts of the same type are on the page

爱⌒轻易说出口 提交于 2019-12-13 05:49:45
问题 I need to get the rendering parameters programmatically from my sublayout. Currently I do this as such: var sublayout = ((Sublayout)this.Parent); //Get all rendering var renderings = Sitecore.Context.Item.Visualization.GetRenderings(Sitecore.Context.Device, true); //Get the first rendering that matches the current sublayout's path var sublayoutRendering = renderings.FirstOrDefault(r => r.RenderingItem.InnerItem["Path"] == sublayout.Path); if (sublayoutRendering != null) Response.Write

How to do Unit Of Work pattern on top of Sitecore's publishing workflows?

杀马特。学长 韩版系。学妹 提交于 2019-12-13 02:26:37
问题 I'm wondering if anyone has ever needed to implement a Unit Of Work pattern on top of Sitecore's publishing workflows? We have a requirement to workflow an 'article' that has multiple linked 'sub-articles', all of which are edited in a block and need to be workflowed through contribution, review and signoff states. Any ideas? Update 24.10.2012 based on Kevin Obee comment: Yes, this look like very interesting approach! Based on it we came up to some similar idea. Instead of creating a

Cannot access sitecore item field via API

爱⌒轻易说出口 提交于 2019-12-12 17:50:22
问题 I've added a new section containing a couple of new fields to an existing data template. The fields appear correctly when logged in as a normal user account. However when accessing the fields using the API, item.Fields["FieldName"] always returns NULL. Things I've tried: Publishing both the item and the corresponding data template Granting "Everyone" explicit read access to the fields (and field section). Confirmed that my dev instance is pointed to the correct database Debugging shows that

DataPager controls use Sitecore layout URL instead of item URL

久未见 提交于 2019-12-12 17:25:02
问题 To implement a search results page on a Sitecore 6.3.1 site, I created a content item at /sitecore/content/Home/Search and added a Search Results sublayout to its presentation controls. The sublayout uses a ListView to display the search results and a DataPager to handle pagination. Here is an excerpt from Search Results.ascx : <asp:ListView ID="SearchResults" runat="server"> <LayoutTemplate> <asp:DataPager ID="Pager" QueryStringField="page" runat="server"> <Fields> <asp:NumericPagerField