1
votes

It is possible to create an item with *** name in sitecore. this would allow to process any page name.

What would be if create * item, and one more (*) like a child item ?

What would be if create * item under bucket item ?

2

2 Answers

9
votes

You can create an item called * in Sitecore. Lets assume that your content tree is:

-home
  - item-a
  - item-b
    - item-c
    - *
  - *
    - item-d
    - *

If you hit url:

  • / - home item is returned
  • /item-a - item-a item is displayed
  • /item-b/item-c - item-c is displayed
  • /item-b/something-else - /item-b/* iten is displayed
  • /aaa - * item is displayed
  • /bbb/ccc - */* item is displayed.

So if there is an item at given level with a name which matches url segment, this item will be used. In other case, Sitecore will check if there is a wildcard item (item with name *), and will continue with matching the next segment.

I've never tried with wildcard items in bucket - I don't think it make much sense there.

0
votes

Marek is right in his explanation (below). I would want to add couple more concerns to think about:

  1. How would you make it Page Editor friendly?
  2. How would address and resolve datasources (by URL? on the fly?). You have just one page item that handles all the matching page requests for multiple datasources.
  3. How would you get Page Not Found (proper 404 status code) support, in case you do not have a datasource?

All that should be taken into consideration before you start implementation. I wrote an article in attempt to answer those questions. Please read at:

http://blog.martinmiles.net/post/wildcard-items-pages-with-mvc-passing-the-correct-datasources-based-on-requested-item-url

Hope that helps.