Does the code of your sublayout make allowances for using the Datasource when it is set over the context item? You can achieve this in a number of ways. E.g in a base class:
protected string DataSource
{
get
{
var sublayout = Parent as SublayoutBase;
return sublayout == null ? string.Empty : sublayout.DataSource;
}
}
protected Item DataSourceItem
{
get
{
return string.IsNullOrEmpty(DataSource)
? Sitecore.Context.Item
: Sitecore.Context.Database.GetItem(DataSource) ?? Sitecore.Context.Item;
}
}
Then inside your code for your sublayout use the DatSourceItem rather then the context item to display content. Another way I have seen this done is to:
protected override void Render(HtmlTextWriter writer)
{
if (this.DataSourceItem != null)
using (new Sitecore.Data.Items.ContextItemSwitcher(this.DataSourceItem ))
{
base.Render(writer);
}
else
{
base.Render(writer);
}
}
Using this all your sublayouts that inherit this in their base class will natively support Data source even if the code is written against the Context item.