WCM Menu without duplicate records

Menu results may contain several results that represent the same piece of content.

Menu results are not unique, Menu results may include multiple results representing the same piece of content as the results can include content and content links.

For example, several content links to the same content may appear in the results for a single menu. It may be desirable to filter these duplicate results, to leave only one.

Following configuration property used to define whether menus should allow duplicate results. If the property is set to false, duplicates will be filtered from the menu results prior to rendering.

The property can be set either at a global level or a per-request level:
  1. To configure the global setting (for all menus), set the following in WCMConfigService.properties:
           menu.allowDuplicateResults=false   (true/false).
  2. To override the global setting, add a request parameter to the request that renders the menu:
           allowDuplicateResults=false   (true/false).

NOTE:
  1. Limitation - Duplicate results will only be filtered when the menu cache is active. If duplicate results appear in menus even though the allowDuplicateResults property has been set to false, increase the value of the menu.cache.max.items property in WCMConfigService.properties to ensure the menu cached it being
    utilized.
  2. "menu.cache.max.items" setting is different from the "services/cache/iwk/menu" , I mean "services/cache/iwk/menu" max size by default 2000, but "menu.cache.max.items" determines how many items in each entry can hold.

Example Scenario
  1. Sitearea "S1-Parent" has following children i.e. content items (c1, c2, c3 ) and sub sitearea called "S1-child"
  2. Sitearea "S1-child" has following children i.e content links (c1-L, c2-L, c3-L) and content(c4)
  3. Have menu component(974b4472-c924-414e-9d98-1103f48e417c) to iterate based on the sitearea (checked the option to include all descents)



Sample URL: Menu pointing to S1-Parent (checked the option to include all descendant's)

Result
C1, C2, C3, C1-L, C2-L, C3-L, C4

URL: Menu pointing to S1-Parent (checked the option to include all descendant's) but allowduplicateresults is false

Result
C1, C2, C3, C4

URL: Menu pointing to S1-Child (checked the option to include all descendant's)

Result
C1-L, C2-L, C3-L, C4

Disable content links in Menu Components completely

To disable the content links completely in the menu components , set the following configuration i.e
menu.includeContentLinks=false  in the WCMConfigService.properties.

URL: Menu pointing to S1-Parent(checked the option to include all descendant's)

Result
C1,C2,C3,C4

URL: Menu pointing to S1-Child(checked the option to include all descendant's)

Result
C4


Ref:

  1. http://www-01.ibm.com/support/docview.wss?uid=swg1PK72350
  2. http://www-01.ibm.com/support/docview.wss?uid=swg1PK64684

6 comments:

  1. Hi, I'm having issue on wcm 8 after migration, having menu component shows dups .. not sure if I should add this on WCM wcmconfigservice, though ? any thoughts .. Thanks EB

    ReplyDelete
    Replies
    1. As mentioned in the article few things need to validate for the duplicate results
      1. do you have the "allowDuplicateResults" setting? is it global setting or per request setting?
      2. check menu.cache.max.items in WCMConfig service, assume if it is 300 and if menu returns more than 300 items then menu doesn't filter the duplicates, in this case you have to increase menu.cache.max.items size.

      Delete
  2. Thanks Siva this helps .. I added the allow DuplicateResults on wcm configservice settings and it work fine .. btw, your blog is really helpful .. EB

    ReplyDelete
  3. Hi Siva,
    I have a question on Menu component and not sure the feasibility of it and below is my question
    How to impose filtering over the results of wcm menu components with wcm pagination and not clientside pagination?

    ReplyDelete
  4. Recently published article on menu resuts pagination (not at cliend side) , please take look at below , it seems will be helpful for you http://blog.sivavaka.com/2015/04/wcm-menu-pagination-or-wcm-navigator.html

    ReplyDelete
  5. Hi Siva,
    I have a question regarding the content which uses the menu component rendering is not updating like images while moving publish content to draft stage.

    ReplyDelete