17

Add a magic "Ok|" string to the abort message, e.g: context.Abort("Ok|Abort pipeline", context); It turns out that the implementation of Abort checks for the magic "Ok|" string: public override void Abort(string message, object context) { base.Abort(message, context); if (message.Contains("Ok|")) return; this.Logger.LogError(string.Format("...


16

Yes there is. Depends on your Sitecore version but you can use: /sitecore/admin/pipelines.aspx Sitecore Pipeline Profiler page The Sitecore Pipeline Profiler page has been in from Sitecore 7 but is disabled by default. You enable by renaming the /App_Config/Include/Sitecore.PipelineProfiling.config.disabled to remove the .disabled extension and setting ...


14

Siva Kumar answer is correct in the most simple scenario. You must know that args.AbortPipeline() doesn't really abort the pipeline. It only sets a flag and all the remaining processors will be still checked and there is a chance some of them WILL be executed. Why? Sitecore allows setting one extra flag on every processor which is called RunIfAborted. If ...


13

Hooks A hook is a mechanism that you can use to run or "register" some logic at initialization time. To create one, you implement the IHook interface and add the necessary configuration as determined by your implemented hook. Hooks are loaded and executed when the application is initialized, via the Sitecore.Pipelines.Loader.LoadHooks processor of the <...


13

Sitecore's built in disablers, like the SecurityDisabler and the EventsDisabler classes, all inherit the Sitecore-provided Switcher class. This class is an IDisposable that can be used to create disablers for use in both pipeline processors and event handlers, without issue. The Switcher class is easy enough to implement, but I have written a more readable ...


9

You actually need to use a completely different pipeline: httpRequestProcessed. This pipeline executes after the session has been initialized. The example below is taken from this blog by Brian Pedersen: namespace MyNamespace { public class MyClass : HttpRequestProcessor { public override void Process(HttpRequestArgs args) { Assert....


9

This is because Sitecore strips it out of the URL once it identifies it as a valid language code. It happens here: <processor type="Sitecore.Pipelines.PreprocessRequest.StripLanguage, Sitecore.Kernel" /> Which is a processor in the <preprocessRequest> pipeline, which runs before the <httpRequestBegin> pipeline that you have hooked in to. ...


9

So for Sitecore - a global error handler in the global.asax will not work properly. The better way to do it is to override the code that calls each rendering and handle the errors there. ExecuteRenderer With a simple override of ExecuteRenderer we can easily catch all exceptions: public class ExecuteRenderer : Sitecore.Mvc.Pipelines.Response....


9

Make sure it runs before the Sitecore.Analytics.Pipelines.HttpRequest.EndAnalytics processor in the httpRequestProcessed pipeline. Otherwise, the contact is set to null in the EndAnalytics pipeline by Sitecore.Analytics.Pipelines.EndAnalytics.ReleaseContact processor.


9

Pipeline To me pipelines are about process. Do this, then this. Allowing you to insert and remove processes simply with patch configs. A great example of this is login user pipeline. Your pipeline would be: Log user in Identify user in xDB Add logging info for user Add user to marketing automation for returning customer etc.... It is a process flow that ...


9

What you want to do is take advantage of Sitecore's branching functionality. A branch in Sitecore is basically a prebuilt item tree that will be copied and inserted where you want it. It could be one item or a thousand items. In your case, what it helps you do is to build out a page, with all the related data folders under the page. All delivered in an ...


8

The usual path I take when approaching these things is to use pipeline profiling. Open the pipelines.aspx page and check if your processor is there, at all. If it isn't, you'll need to review your .config patch file. Clear the result set by clicking "Reset". In another tab, make an HTTP request to a page on your site. Refresh pipelines.aspx. The above ...


8

When you create a new tenant it is disabled by default. You need to enable it. On the tenant item on Administration section you have a checkboxfield Enabled Please see below image: You can enabled or disabled a single pipeline batch. On the pipeline batch processor item on Administration section you have a checkboxfield Enabled Please verify if is ...


8

I can suggest the following solution: You need to implement a custom field reader with a custom field converter: using Sitecore.DataExchange.DataAccess; namespace Example { public interface IBaseValueReader: IValueReader { string AttributeName { get; set; } } } AddressFieldReader: using System; using Sitecore.DataExchange.DataAccess;...


8

Yes, you can do it by the following way. Configuration: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <mvc.renderRendering> <processor type="YourAssembly.LogExecuteRenderer, YourAssembly" patch:instead="processor[@type='Sitecore.Mvc.Pipelines.Response.RenderRendering....


7

You can read about Pipelines on the Sitecore community docs website: http://sitecore-community.github.io/docs/pipelines-and-events/pipelines/ Pipelines are one of Sitecore’s essential integration concepts. They are used to extend existing functionality, and to allow custom functionality to be extended in the future. They also provide a level of ...


7

Prepare for a huge wall of text here which is not tested, but should work in theory and is a perfect blog post material :) So the easiest way to do this, is to actually act to the unselectable items in the same way that Sitecore reacts to the unselectable templates - i.e. showing a message and telling that this is not a valid choice. So the first stop ...


7

I've done this before using a wildcard item for the parameter and a custom resolver processor that runs just after the ItemResolver - The ItemResolver should resolve to /sitecore/content/mysite/products/* - so in my custom resolver I know if I'm on that item, parse the Url, take the last segment and store the value somewhere - like Sitecore.Context.Items["...


7

Like Mark Cassidy mentioned above, <mvc.requestBegin> would be a close "equivalent". I ran into a similar situation wanting non-authenticated users to be redirected to the <site loginPage="/login">. The only caveat I had was that I needed some custom logic to create virtual users based on their IP address (site to site VPN), so I decided to ...


7

Use two browsers: when logged in as sitecore\admin and extranet\xxx might break other things as well. Use a chrome-browser and incognito window to truly have a visitor experience. This is better from a security perspective as well.


7

In this context, domains does not refer to security domains, rather controlled area. Pipeline groups could be used for namespacing your pipelines, for example when creating custom pipelines to ensure they do not conflict with other custom pipelines, however this can already be achieved otherwise (and more elegantly) when naming your pipeline, as pointed out ...


7

You can create your own class: public class ClearCookieHttpModule : IHttpModule { public void Dispose() { } public void Init(HttpApplication context) { //hook end request context.EndRequest += new EventHandler(OnEndRequest); } void OnEndRequest(object sender, EventArgs e) { ...


7

Since you are using SXA, the module provides OOTB error handling settings which allow you to set site specific 404 and 500 pages. I couldn't find any linked documention on the Sitecore site but you can set the error pages on the /{tenant/{site}/Settings Item: These settings are added when you create the tenant, make sure you have selected Error Handling: ...


7

Assuming you're running Sitecore 8.2 or later, you can add resolve="true" to the <pipeline> element to enable DI resolution for the processor. Sitecore uses Microsoft.Extensions.DependencyInjection for dependency injection, which doesn't appear to list Windsor as a supported container. It may be possible, but I'd seriously consider whether Windsor ...


7

There's no pipeline or event that you can plug into in the general sense of Sitecore's pipelines and events that you see in the ShowConfig. Instead, it's driven by an Item based pipeline provider. This is accomplished by creating what's called Workflow Actions that allows you to execute code when a workflow is changed to that state. There's an example of ...


7

Yes, you can debug processors in the <initialize> pipeline the same as any other pipeline in Sitecore: set your breakpoints and attach to the w3p process from Visual Studio. The issue is that the <initialize> pipeline only runs once when the application starts up, but normally you are attaching to debug the process after that code has already ...


6

Pipelines are defined in config. Sitecore's pipelines exist under: <sitecore> <configuration> <pipelines> Within a pipeline, handlers are processed in the order they are defined in config, the order and position of a handler is relevant. Here is a list of available pipelines The <httpRequest> pipeline is perhaps one of ...


6

Rather than an item named product, create an item named products that represents the entire collection, and then create a child item named * to represent any individual product. Wildcard items will be resolved with any path that doesn't match an existing item, so if your tree is: /products /products/example /products/* A request to http://example.com/...


5

There are actually a few options here: Command Templates Event handlers (item:added) Pipeline processors (uiAddFromTemplate, addFromTemplate) Command Templates This is by far the simplest solution, requiring the least implementation effort but is also the least extensible and flexible. What you would do is create a command template item under the branch ...


5

You can use the /sitecore/admin/showconfig.aspx page to view the generated Sitecore configuration to verify if you're custom pipeline is inserted into the pipeline and it's position of execution.


Only top voted, non community-wiki answers of a minimum length are eligible