2

I have a "NewsItems" node in sitecore with multiple "News" children nodes with same name, same display name and same item path, only body content of each news item is different.

I am displaying all news items using sitecore 7.2 search api on a page with a link to individual news item, when user clicks on a link and navigates on the individual news item page and there I am displaying body of the news item.

Problem is that same body content is being displayed for all news items, although they are different items and have different body content but somehow sitecore is picking the first news item and use that as currently selected item and displays its content.

7

Your problem is that the links will be generating a path, and all the links will have a path like:

/newsitems/news

Sitecore can only match an item there by path name, so its going to pick the first one in the list that it finds.

You have 2 options:

Option 1 - generate the links using the Guid of the item, this is terrible for SEO (although having multiple page with the same URL is just as bad)

Option 2 - and the one most would go for, is to name your child items with unique names. Although Sitecore allows duplicate names in the tree, this should never be allowed to happen.

Not just because it causes a content delivery and path matching problem, but also, it must be a nightmare for content editors to work out which item they should be editing? Your news items most probably have a Title or Subject Heading - you can use that for the item name. Don't name them all News - it will never work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.