This is known issue. Here is the private fix.
In web\controls\blocks\BlockContainer.ascx.cs
add the following line to the class variables.
private Dictionary<int, int> blockIds = new Dictionary<int, int>();
replace the following to AddBlockToContainer method.
private BlockUserControl AddBlockToContainer(int blockId, Control containerControls) {
Block block = Block.GetById(blockId);
if ((WebUtils.IsPageEditorEnable() && (!blockEditorDisabled) && (!EditorDisabled)) || CheckCondition(block.Conditions)) {
BlockUserControl buc = (BlockUserControl)LoadControl(block.BlockType.VirtualPath);
if (blockIds.ContainsKey(blockId)) {
blockIds[blockId]++;
buc.ID = string.Format("Block_{0}_{1}", blockId, blockIds[blockId]);
} else {
blockIds.Add(blockId, 1);
buc.ID = string.Format("Block_{0}", blockId);
}
buc.BlockId = blockId;
buc.BlockContainerId = BlockId;
if (null != BlockContainerType)
buc.BlockContainerType = BlockContainerType;
buc.Data = block.Data;
if (isFirstBlock)
isFirstBlock = buc.MoveForwardEnabled = false;
buc.EditorDisabled = EditorDisabled || blockEditorDisabled;
Control controlToAdd = buc;
if ((null == block.HeaderData) && (masterColumnWidth > 0)) {
//Enable block header by default when inside master columns
block.HeaderData = new BlockHeaderData() {
Enabled = true,
Height = 27,
Title = block.BlockType.Type,
Width = masterColumnWidth
}.ToXElement();
}
if (null != block.HeaderData) {
buc.HeaderData = Utils.FromXml<BlockHeaderData>(block.HeaderData.ToString());
if (buc.HeaderData.Enabled) {
HtmlGenericControl blockDiv = new HtmlGenericControl("div");
blockDiv.Attributes.Add("class", "block");
HtmlGenericControl header = new HtmlGenericControl("div");
header.Attributes.Add("class", "blockHeader");
header.Attributes.Add("style", string.Format(BlockHeaderFormat, buc.HeaderData.Height - 6, buc.HeaderData.Width, buc.HeaderData.Height));
header.InnerText = buc.HeaderData.Title;
blockDiv.Controls.Add(header);
blockDiv.Controls.Add(buc);
controlToAdd = blockDiv;
}
}
containerControls.Controls.Add(controlToAdd);
return buc;
}
return null;
}
DotShoppingCart Staff
|