0
votes

I have a scenario where I have a nested listing page which needs to exist in different locations of my website.

The problem is I want this listing page to be managed in one location instead of having to copy it in many places and yet I don't want to lose the URL structure. So, I might have

www.abc.com/infocomm/infrastructure/wired/that-listing-page www.abc.com/infrastructure/ipv6/that-listing-page

I've tried to create the listing page in a content store and use the wildcard query to pull out the child pages dynamically but this has a few drawbacks:

  1. Using the rich text editor, the content author can't create hyperlinks to the listing page items because they exist in the content store and they have to hardcode the query strings to get the listing page item. For example, they have to hardcode the parameters as below:

www.abc.com/infocomm/infrastructure/wired/that-listing-page/2012/article-1

  1. Because of #1, there will be many broken links if the content author renames the items under the listing page or delete the items.
  2. We have to migrate the existing contents and that means we have to manually update and hardcode the new links which will lead to the first problem.
  3. We can't generate the Google sitemap and RSS feeds because of the challenges as above.

Some of you guys might have experienced this scenario before, I would love to hear how you guys achieved it. I'm using Sitecore 6.5.

2

2 Answers

1
votes

It looks like Item Cloning is exactly what you need here. Read more about Cloning in this blog post.

You should be able to create a clone of www.abc.com/infocomm/infrastructure/wired/that-listing-page item under www.abc.com/infrastructure/ipv6 and it will update automatically (as well as its descendants).

0
votes

If I understand correctly you want to display links for items from different content nodes on this page.

Easiest solution I can think of is create a new template for listing page and setup treelist select box field on the template and add /sitecore/content/Home/ for which you want to get descendants from.

Now in the code iterate through the selected items and display them on the list page. When you get the items you should be able to get all field values of the selected items and probably that will give you thumbnail images and generate links using following code

 Sitecore.Data.Database dataContext = Sitecore.Context.Database;

Sitecore.Data.Item listPageItem = Sitecore.Context.Item;

Sitecore.Data.Fields.MultilistField multiselectField = 
                  (MultlistField)home.Fields["[select list field name]"];

Items[] selectedItems = (multiselectField != null)? 
                             multiselectField.GetItems() : null;

int listCount = (selectedItems ==null)? 0 : selectedItems.Length;

for(int index=0; index < listCount; index++)
{

   Item item = selectedItems[index];


   //  Assuming you want to display thumbnail image as a link to the page
   string thumbnailUrl = item.Fields["[Thumbnail Image Path]"] 

   string imgTag = string.Format(@"<img src=""/{0}"" width=""[img width]"" 
                   alt=""{1}"" />", 
                   thumbnailUrl, 
                   item.Fields["[Title]"]);

   string url = Sitecore.Links.LinkManager.GetItemUrl(item); 

   string itemLink = string.Format(@"<a href=""{0}"">{1}</a>", url, imgTag); 

}


Hope this help ...