Archive for November, 2008

Using fieldcontrols in a ListView

When you want to use a fieldcontrol like a Text, Link or Image control in a ListView you need to specify a datasource. By not specifying a datasource Sitecore looks at the current item. Which in a ListView is not the right one. So you need so set the datasource in code-behind or use an Eval expression in code-before.

When you want you use the code-behind option you need to raise an eventhandler which triggers the ItemDataBound handler.In that event you want to get the values of the current item. So you need to cast the ListViewDataItem to an Sitecore item.


Read more

Maximum number of Sitecore query items

Last week I had some problems with an Sitecore Query. It didn’t show more than an fixed number of items. After some hard thinking I rembered that there is a web.config key called Query.MaxItem which, you might guessed it, controls the maximum number of results of an Sitecore Query.

Using profile with the Rich Text Editor

Regularly I see topics on the SDN5 forums where people ask if it is possible to use a custom Rich Text editor. Wll, yes it is. You can use so called profiles with the Rich Text editor. These profiles are stored in the Core database under /sitecore/system/Settings/Html Editor Profiles/. There are some default pre-configurated profile which you van duplicate and customize to your own needs.

To use these profile you need to set the source value of an rich text field in your template.

Sitecore 5 Rich Text Editor