sitecore

Open sitecore media library programmatically from asp.net button click

家住魔仙堡 提交于 2019-12-18 08:53:07
问题 I have been trying to figure out if it is possible to open the Sitecore media library browser programmatically from ASP.NET code-behind on a server-side button click. By searching the net, I found an example which explained how to open a media library browser from a Sitecore thumbnail click. I tried this approach on ASP.NET server-side button click but it did not work failing with object reference not set to an instance of an object . Can anyone please help me if you know how to open the

Open sitecore media library programmatically from asp.net button click

穿精又带淫゛_ 提交于 2019-12-18 08:51:10
问题 I have been trying to figure out if it is possible to open the Sitecore media library browser programmatically from ASP.NET code-behind on a server-side button click. By searching the net, I found an example which explained how to open a media library browser from a Sitecore thumbnail click. I tried this approach on ASP.NET server-side button click but it did not work failing with object reference not set to an instance of an object . Can anyone please help me if you know how to open the

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 authenticate users against external membership database

萝らか妹 提交于 2019-12-17 11:00:27
问题 I have a Sitecore site where I want to have website visitor accounts stored in an external asp.net membership database but keep Sitecore content editors/admins managed via the Sitecore interface (and hence stored in the 'Core' database). I've read through the following forum post http://sdn.sitecore.net/SDN5/Forum/ShowPost.aspx?postid=35305 in which the following documents are mentioned http://sdn.sitecore.net/upload/sitecore6/62/membership_providers_sc62-a4.pdf http://sdn.sitecore.net/upload

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 exclude fields form being indexed with Sitecore search (new method)

限于喜欢 提交于 2019-12-14 03:44:13
问题 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 回答1: 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

Sitecore Glass Mapper ObjectToSwitchTo null reference in page editor

*爱你&永不变心* 提交于 2019-12-14 03:13:16
问题 I have the following structure as Template in visual studio : Under a page, i have one or more link root [SitecoreType(TemplateId = "{4AAA9A10-36C2-484F-A648-2BEF349F0052}", AutoMap = true)] public class LinkRoot : IBaseTemplate { [SitecoreChildren(InferType = true)] public virtual IEnumerable<LinkItem> Children { get; set; } [SitecoreInfo(SitecoreInfoType.TemplateId)] public virtual Guid TemplateId { get; set; } public Guid Id { get; set; } public string Language { get; set; } public ItemUri

Sitecore Media Library MaxSize

谁说我不能喝 提交于 2019-12-14 02:34:18
问题 In Sitecore, I'd like to set Upload MaxSize only for image files. We can update Media.MaxSizeInDatabase to set the MaxSize, but this setting includes all files in Media Library. Is there any way to set MaxSize only for image files? Or, can I create any validation for this?? Thank you in advance!! ========= Update ========== I tried to use all code and setting, but it was not working. I think Code is fine, but I might have to make sure the place of configurations. When I add "xmlns:patch"

Remove All Referrer Items in Sitecore

☆樱花仙子☆ 提交于 2019-12-14 02:32:54
问题 I have a layout item in Sitecore and I am able to identify all the referrer items via Links button. I have tons of referrer items, I would like to remove all of them. I am hoping that I won't have to go through each item individually to delete the reference items. I am also hoping not to delete the referred items and recreating it since it will generate different GUID for the new item. Is there a way to do this via Sitecore Desktop or SQL Server? 回答1: You can create a dynamic Asp.net page

Sitecore Field Renderer - add markup inside rendering

假如想象 提交于 2019-12-14 02:17:44
问题 As part of an SEO enhancement project, I've been tasked with adding the following property inside the markup for the image that the field renderer is generating on the page: itemprop="contentURL" - before the closing tag. <sc:FieldRenderer ID='FieldRenderer_MainImage' Runat='server' FieldName='Homepage Image' CssClass="_image" Parameters="w=150" itemprop="contentURL" /> When I tried to place this inside the Field Renderer, or add it as a "parameter" - it doesn't work. Is there another way to