Thursday, November 17, 2011

Sitecore Item default fieldname

Hi Sitecore Devs,

Just thought of sharing the list of Sitecore item default field name (see the imagess below). I believe you can find the listing in a page or pdf somewhere in SDN, but it could be hard to find.

Anyway, if for example you would like to retrieve an item "created by" value

You can do so by

Var createdBy = Sitecore.Context.Item[“__created by”];

Or

Var createdBy = Sitecore.Context.Item[Sitecore.Data.Fields.FieldIDs.CreatedBy];

The later approach by using Sitecore.Data.Fields.FieldIDs. is neater however it does not list the full Sitecore item default field name.



Wednesday, November 16, 2011

Sitecore User Manager is blank (showing gray background with no controls)

Today, I encountered an issue where the user manager in Sitecore was not displaying anything. The only thing that was visible in Sitecore backend was gray backgrounds with no controls.

I asked my colleague and he suggested to replace bin and Sitecore files with the same version of vanilla(fresh) sitecore bin and files.

Done that and cleared the cache however the problem persisted. So next the next thing I did, was to check if the domain has been listed in IE trusted site list. Apparently, the domain was not added to the list. Once I have added the domain to the list, Sitecore backend works as per normal.

The IE version I use was IE9.

Debugging Sitecore 404

Recently, I was baffled with Sitecore throwing 404 error page. This makes things even more so confusing with the following status/checklist

1. Site used to run
2. There is no code changes. The only change was domain name
3. IIS Binding has been configured with the new domain
4. Site is up and domain has been pointed to the correct webroot. I tested this by dumping test.txt on webroot and try to access it by /test.txt. I can get the text file.
5. Changes also have been made on Site definition to relect the new change in domain name
6. Sitecore backend can be accessed
7. I have checked the item exist in backend

Finally i figured out the problem when i inspected the url for the 404. It looks something like below

http://domain.com/Standard-Items/Error-Pages/Page-Not-Found.aspx?item=%2f&user=sitecore%5cAnonymous&site=scheduler

As you can see, the query string "site" is scheduler. That's not right, it should be "website". So I look at site definition again for error