an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Blog > Customization > Replace Dynamic Block Header Background With th...
Replace Dynamic Block Header Background With the Customized Static Image
In DotShoppingCart themes and skins are dynamic. When you change the colors in site admin, all the images in the themes are created again by using GDI+ API.
 
Check the areas surrounded by the red rectangles below. These background images are created dynamically.
 
and
 
 
The bottom ones are called block headers. This article describes how you can replace the block headers with your customized static images.
 
The css class for the block headers is "blockHeader". If you search the "blockHeader" against your entire solution, you will find one in Default.css
 
div.blockHeader {
    text-align:center;
      font-weight: bold;
}
 
div.blockHeader a {
      text-decoration: none;
}
 
and the other one in web/controls/blocks/BlockContainer.ascx.cs.
 
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);
 
To use your customized static image as the block header background, please do
 
1) Add your background image to the div.blockHeader css style e.g. background-image:url(<your image url>);
2) Remove the code adding the inline style
header.Attributes.Add("style", string.Format(BlockHeaderFormat, buc.HeaderData.Height - 6, buc.HeaderData.Width, buc.HeaderData.Height));
 
Here is an example of the customzed header blocker.
 
 
Recent Comments
danny jones said ...
Hi... I am inexperiance to build up ECommenrce type sites.I have a little bits knowladge ...
molakaj said ...
What a great approach to the subject, I was looking for. Thanks for these tips http://www ...
jane said ...
Thank you for this useful information.
furnace parts said ...
Congrats on V4.0.....It is so easy to use  
Travis said ...
I just bought DSC Suite V4.5 and it is more solid then ever. I hope I am #1 buyer of this ...