Sitecore OMS - Best Practices for Content Hierarchy

I am inheriting an existing Sitecore implementation that has large content folders, all using the same template. Some of the folders contain literally hundreds of articles. Different folders should be of interest to different types of characters. I would not want articles on articles to set the Personas and Profile properties for each individual page. Ideally, I would like to enter properties only once for the entire article folder. What is the best practice then?

Should I create a different template for each type of article? Or is there a way to inherit these properties from the parent in the content tree?

thanks

EDIT

I had an online conversation with John West, CTO of Sitecore USA. Here are his suggestions for solving this problem. I thought to share them here, as some other people may be interested in solving a similar problem.

I do not know of any existing solutions for inheriting these values, but there are probably other approaches (possibly similar to rolling back the language).

If the number of templates is relatively small, I would probably go with an approach template - turn the existing template into a basic template for templates for all existing elements and change the insertion parameters accordingly. It would not hurt to put these things in folders, but they do not inherit these values ​​in this way (you could implement something that would inherit them, as mentioned above). One of the advantages here is that you can update this data in standard values ​​that apply to all elements based on these templates.

Another way would be to implement something like security layouts and presets, but for these other values.

No matter what you do, make sure that when the user creates a new item, they can use these properties every day, or they are automatically applied.

Another way would be to write a script that updates existing elements, but that doesn't help in future elements (unless you do something like a save handler to automatically apply the same values ​​when creating). Perhaps copy the values ​​from this parent folder.

I liked the idea of ​​adding a logical field to an existing template that controls whether the element should copy the profile values ​​from its direct parent, and then implement a save handler to copy when this field is set to true. So I asked John if there were any documents on how to create such handlers. Here is his kind answer:

This explains some of the ways in which you can click on position creation / change to set your values:

http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2010/11/Intercepting-Item-Updates-with-Sitecore.aspx

I assume you can use an element: a stored event handler. I avoid item: handlers created, because if my logic goes wrong, I want it to run again in the next save event. In your case, if these fields are empty, you probably want to set the value.

You can use factory to pass parameters to your event handler to avoid hard coding. For example, you can pass the database name wizard (abort the handler if the saved item is in another database) and a list of corrupted template identifiers. Then you can easily add templates to the list in the future.

http://www.sitecore.net/en/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2011/02/The-Sitecore-ASPNET-CMS-Configuration-Factory.aspx

Here is some event information:

http://sdn.sitecore.net/Articles/API/Using%20Events.aspx

This is an example that uses a save handler:

http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2010/06/Sitecore-Shared-Source-NewsMover-Categorizes-News-by-Date.aspx

+6
source share
1 answer

I think there might be a better way to do this using the startTracking pipeline. Check out the Sitecore.Analytics.Pipelines.StartTracking.ProcessItem processor. Here Sitecore retrieves the context element and registers its profile values ​​in AnalyticsTracker using the supporting class TrackingFieldProcessor. You can duplicate this class, and depending on the template of the context element (or flag on the template), also register its parent profile data using the TrackingFieldProcessor.Process (Item) method.

EDIT

This is a bit new to me, too, as for the Sitecore API, but here are the more specific steps you should try. You must use IlSpy to view the reference classes in Sitecore.Analytics.dll.

  • Subclass Sitecore.Analytics.Pipelines.StartTracking.StartTrackingProcessor
  • Implement the Process method using Sitecore.Analytics.Pipelines.StartTracking.ProcessItem as a link. If Context.Item meets your criteria (for example, the GUID of the template), use the following code to track analytics based on its parent.
  • Add your class to Sitecore.Analytics.config as the last element in the startTracking pipeline.

    TrackingFieldProcessor trackingFieldProcessor = new TrackingFieldProcessor (); trackingFieldProcessor.Process (item.Parent);

If you are not familiar with using pipelines:

http://adeneys.wordpress.com/2008/08/27/creating-and-running-custom-pipelines-in-sitecore/

(Although this is not a custom pipeline, you just click on an existing one.)

+3
source

Source: https://habr.com/ru/post/888234/


All Articles