sitecore

Sitecore enables accessing child node around parent

北城以北 提交于 2019-12-02 10:13:44
I have a sitecore multisite setup. i'm currently struggling with the "duplicate content syndrome" were google bots indexes my sites and is able to access the content of the opposite site. this means it finds the same content on 2 different hostNames which gives the sites a lower rating in a google search. The reason it finds duplicate content is that i am able to access a child node on the oppsosite site than the one i'm currently browsing by typing the name in the URL. This is my web.config setup of the sites: < site name="website2" hostName="local.domain.dk" virtualFolder="/" >physicalFolder

Find sitecore items with a specific OMS profile?

不羁岁月 提交于 2019-12-02 08:19:41
问题 I have to find all items in Sitecore (or rather, in the contents) that have a certain OMS (marketing suite) profile checked in the "Tracking" attribute. The Tracking attribute appears to be stored as XML and has a raw value like <tracking> <profile name="Widdly Scuds"><!-- some irrelevant keys... --></profile> </tracking> and I need to fetch, for example, all items with the "Widdly Scuds" profile. The first solution I thought of was fast query over the Tracking attribute. Sitecore query or

Run code when Publishing Restriction is saved in Sitecore

旧城冷巷雨未停 提交于 2019-12-02 08:01:14
I need to run code when an author saves a publishing restriction for an item. How would I go about doing that? Lukas Kozak The time restrictions are stored in the "__Valid to" and "__Valid from" fields. Attach a new pipe like this: <event name="item:saved"> <handler type="Test.ValidTest, Test" method="OnItemSaved" /> </event> And then test if those fields changed and do your thing: public class ValidTest { private static readonly ID __Validfrom = new ID("{C8F93AFE-BFD4-4E8F-9C61-152559854661}"); private static readonly ID __Validto = new ID("{4C346442-E859-4EFD-89B2-44AEDF467D21}"); public

How to sort the selected items in a Sitecore Treelist?

拜拜、爱过 提交于 2019-12-02 07:36:19
问题 Is there a way to always have the selected items in a Sitecore Treelist sorted alphabetically? 回答1: No, but you could look in to creating your own 'sorted treelist'. Someone asked a different question earlier today but it has basically the same answer: Sitecore Tree list datasource - VersionExist Sitecore lets you create custom field types. They can be based on existing ones, but with some added tweaks. As mentioned in the answers to the other question, here are 2 articles which are good

Sitecore query/fast query for user

心已入冬 提交于 2019-12-02 07:12:23
Is there a way to use fast query or query to get a user by email or a custom field? I tried this but it didn't work in the Query Tool /sitecore/user//*[@@templateid='{642C9A7E-EE31-4979-86F0-39F338C10AFB}' AND @email='abc@123.com'] You cannot query (via Sitecore Query or Fast Query) users in the User Manager because they are not items, they're actually built on ASP.NET Membership in the Core database. Instead, you can look into something like Membership.GetAllUsers() ( MSDN doc ) and filter the results with LINQ based on what you're looking for. I've done something similar in Sitecore where I

Glass.Mapper not applies additional parameters in BeginRenderLink method

佐手、 提交于 2019-12-02 07:11:09
问题 For Glass.Mapper BeginRenderLink described as method to render a link that should contain multiple HTML elements: http://glass.lu/docs/tutorial/sitecore/tutorial22/tutorial22.html What I'd like to add is custom attributes (class, style) to that link: <% using (BeginRenderLink(x => x.Image1Link, new NameValueCollection { { "class", "image-banner" }, { "style", string.Format("background-image: url({0})", Model.Image1.Src) } }, true)) { %> <span class="image-banner-wrapper"> <span class="image

What inbuilt parameters can I access in Sitecore XSLT? How should I expose global settings I need?

情到浓时终转凉″ 提交于 2019-12-02 06:39:25
Is there a list of inbuilt parameters available to Sitecore XSLTs? I've looked around but haven't seen anything that looks like a full list, at least not in comparison to the sort of data a .NET component can access directly. Using XSLT out of the box in Sitecore seems a little limited in respect to the data it can easily access in comparison to .NET presentation components. I'm specifically interested in being able to access various pieces of information relating to running multiple sites and languages on a single instance installation - the home node, host name, site name etc. In .NET most

Find sitecore items with a specific OMS profile?

你离开我真会死。 提交于 2019-12-02 06:26:49
I have to find all items in Sitecore (or rather, in the contents) that have a certain OMS (marketing suite) profile checked in the "Tracking" attribute. The Tracking attribute appears to be stored as XML and has a raw value like <tracking> <profile name="Widdly Scuds"><!-- some irrelevant keys... --></profile> </tracking> and I need to fetch, for example, all items with the "Widdly Scuds" profile. The first solution I thought of was fast query over the Tracking attribute. Sitecore query or XML would have to crawl the entire contents each time, which would probably be unacceptably slow, but I

Getting Sitecore 404 for physical files

别说谁变了你拦得住时间么 提交于 2019-12-02 05:28:10
问题 The media library URL (/sitecore/shell/Applications/Media/MediaShop/default.aspx) is being picked up by the SiteCore handler and redirected to the page-not-found page Sitecore uses (/sitecore/service/notfound.aspx). The file is a physical file and is actually there. I've seen things like this happen with items in the Sitecore content tree, but not with physical files. Any ideas where to look would be appreciated. Thanks. Update: So, the issue as described above is fixed, but it's clear that

Why isn't my Enumerable getting populated by Glass.Mapper?

孤人 提交于 2019-12-02 04:49:34
I'm totally confused as to why this isn't working. I have a class with a list of other classes as a property of it: public class Widget { .... public virtual IEnumerable<WidgetButton> Buttons { get; set; } } [SitecoreType(TemplateId = "{B615973D-59F6-437E-9827-BA3A40068C69}", AutoMap =true)] public class WidgetButton : BasePage { [SitecoreField] public virtual string Title { get; set; } } My sitecore item has a TreeListEx with one item in it: and I'm reading this item thus: Widget widgetTest = SitecoreContext.GetItem<Widget>(new Guid("{4FF5B96F-9606-4581-95F7-B6A7BAA4C28F}")); My Widget (