Sunday, April 2, 2017

Sitecore8.1 : Resolve Wildcard (*) Item and fix presentation not cloned from * item


This is the Sitecore structure for wildcard item (*)
  • sitecore
    • content
      • Site name
        • Home
          • Blogs
            • *
        • Globals
          • Blogs Folder
            • Year
              • Month
                • Blog Article 1
                • Blog Article 2
So according to this structure, we have #Wildcard Item(*) under the home node. It is like Blog detail page that is under Blog landing page.


Under Globals folder we have all blogs, those are actual blogs Detail Pages, we need to resolve.



First I have added new configuration file (z.wildcard.config) with the following configurations

  1. created httpRequestBegin processor as a batch to be executed after Item Resolver  to Call Wildcard processor
  2. Sitecore 8.1 observed the following issues
    1. 1. Wildcard items no longer work
    2. 2. Presentation for cloned items not found

Solution:
If you are using MVC with Sitecore 8.1 then add <mvc.getPageItem> after our processor to avoid any route conflict


The last point is to add settings to disable ItemResolving.FindBestMatch because it's enabled in Sitecore 8.1 which may cause wildcard redirect issues



    
  • Add class WildCardItemResolver which include the processor to resolve wildcard



4 comments:

  1. Hi, I am unable to find GetWildCardPageItemProcessor processor in this blog. Please help on same if there is any other blog post. Also i want to understand how are you cloning presentation to resolved items.
    Please help and suggest.

    ReplyDelete
    Replies
    1. Hi,

      Thank you for letting me know,I just added GetWildCardPageItemProcessor class, hope it is helpful now.

      Delete
    2. Cloning is acheived as soon as he returns "return Context.Item;" from the pageItem pipeline , the next processor has that info in the "args". As we know in Sitecore the data in pipeline args is transferred from processor to processor. Correct me if I my understanding is incorrect @Hanin

      Delete

Sitecore : Rendering Exception Handling

To prevent showing yellow crash page if an error raised in one of Sitecore controls  and keep handle errors for developers without showing ...