The latest edition of Nopcommerce supports 2 colums on the home page The left menu and the Category-content page. In style sheets it is: The container:MasterWrapper-content which hold every thing Then we have also the Div-Master-Wrapper-Side: Which holde the left Menu's Category, Information etc.. And we have the : Div-Master-Wrapper-cph, i geuss this is the content holder
Can we have next to this Div-Master-Wrapper-cph another DIV which contains actions in store, new products links etc..
Then you have three columns like Div-Master-Wrapper-Side and Div-Master-Wrapper-cph and the new one Div-Master-Wrapper-RSide for instance
Is this possible and what do i have to do to change the syle sheet for the default.aspx page. or do i have to make a new lets say threeColumns.Master
you would need to modify the existing, or create a new master page with the layout you want. You can add the new column using css. We will be implementing nested master pages in the next release so you may want to look into this as you can keep common elements like logo, links, footer on all your master pages. Hope this helps, Ben
For now i just created a new Master Page. Name:Custom.Master with the same html and code behind as the main.master But know with two content place holders.
Only the lines in the default.aspx i change where: code: <%@ Page Language="C#" MasterPageFile="~/Custom.master" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Default" CodeBehind="Default.aspx.cs" %>
And the holder of the third column i placed after the ending code of the first content holder "cph1" the second content holder <asp:Content ID="Content2" ContentPlaceHolderID="cph2" runat="Server"> <div class="clear"> </div> </asp:Content>
Now i have a third column where i can place new products, and default "RecentlyViewedProducts" in.
I tried your codes for the 3 column and I got the following errors: [quote] Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Source Error:
Line 38: <asp:ContentPlaceHolder ID="cph1" runat="server"> Line 39: </asp:ContentPlaceHolder> Line 40: <asp:Content ID="Content2" ContentPlaceHolderID="cph2" runat="Server"> Line 41: <div class="clear"> Line 42: </div>
Source File: /Custom.master Line: 40
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082[/quote]
Any idea what I have done wrong? Can you give me the Custom.master codes you have?
I have 2 questions for now. Did you used the latest version of NopCommerce on this site or did you download the updates om www.codeplex.com. There there is an example with nested master page
I will try to explain the one used on this site 1.11
1. when you create a new master page lets say Custom.master or better name it ThreeColumn.master 1a) Watch the code behind of the main.master and copy the the code behind in yours then you have to changed some variable names
ThreeColumn.master.cs
Example of codebehind: using System; using System.Collections; using System.Configuration; using System.Data; using System.Text; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using NopSolutions.NopCommerce.Common; using NopSolutions.NopCommerce.Common.Configuration.Settings; using NopSolutions.NopCommerce.Common.Promo.Affiliates; using NopSolutions.NopCommerce.Common.SEO; using NopSolutions.NopCommerce.Common.Utils; using NopSolutions.NopCommerce.Common.CustomerManagement;
namespace NopSolutions.NopCommerce.Web { public partial class ThreeColumn: BaseNopMasterPage { protected override void OnLoad(EventArgs e) { base.OnLoad(e); } } }
1 b) Get Back to the HTML Source and change the directives of the first line:
1 C) From here you need to combine the html in ThreeColumn.master with the stylesheet and play around with the Width of you're containers. i called the newly created div "<div class="master-wrapper-Actions">" Within this div i placed the recently view products. My geuss is to leave the menu as it is and not mix it up with other information.You can also placed the shopping cart in this section or promotion/actions, eye catche stuff to sell etc..
I also placed in this example the search box left above the categories, in the vertical menu, because i will ad some additions to the search. But you can comment this out. These lines are reconized by "<nopCommerce:SearchBox runat="server" ID="ctrlSearchBox"></nopCommerce:SearchBox> <div class="clear"> </div>"
1 d) Nop open style sheet in the master.css, location "NopCommerceStore\App_Themes\darkOrange". In here i made some changes i change the default width to 1024px instead of 830 i geuss it was. Look out in the css file beneath i used different images. Most of them end with .PNG so you could reconised my changes.
background: url(images/ActionHeader.png) left top no-repeat; display: block; overflow: hidden hidden; padding: 15px 0 9px 0px; }
1 e) Now it is possible to change the directive in the default.aspx page, this is the first line. Could be that here you are missing the search if it was not included in the Menu header as a NopCommerce controle. Also the placeholder for the third column is added in here. <asp:Content ID="Content2" ContentPlaceHolderID="cph2" runat="Server"> <div class="clear"> </div> </asp:Content>
In the new code you can download from codeplex similair can be done. Hope it helps my english is not all that.
Hope it helps you one the way if something is missing or you do have questions let me know.
Ps: 1 Don't forget to rebuild the site in visual studio 2008. 2 Make a copy first of you're origanel and/or use Araxis merge or other application to watch changed made if you update the site when you added some custom code.
//------------------------------------------------------------------------------ // The contents of this file are subject to the nopCommerce Public License Version 1.0 ("License"); you may not use this file except in compliance with the License. // You may obtain a copy of the License at https://www.nopcommerce.com/License.aspx. // // Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. // See the License for the specific language governing rights and limitations under the License. // // The Original Code is nopCommerce. // The Initial Developer of the Original Code is NopSolutions. // All Rights Reserved. // // Contributor(s): _______. //------------------------------------------------------------------------------
using System; using System.Collections; using System.Configuration; using System.Data; using System.Text; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using NopSolutions.NopCommerce.Common; using NopSolutions.NopCommerce.Common.Configuration.Settings; using NopSolutions.NopCommerce.Common.Promo.Affiliates; using NopSolutions.NopCommerce.Common.SEO; using NopSolutions.NopCommerce.Common.Utils; using NopSolutions.NopCommerce.Common.CustomerManagement;
namespace NopSolutions.NopCommerce.Web { public partial class ThreeColumn : BaseNopMasterPage { protected override void OnLoad(EventArgs e) { base.OnLoad(e); } } }
1 c) Replace the lines in the master.css, located in the darkOrange folder, until the the comment of the header sections
That's it i guess,Recompile or rebuild the solution.
PS 1) use FireFox and install Color-zilla free plugin under web developer section, i think it is, you will get a color picker which you can use to see the divs etc..
2) Changes made in aspx or stylesheets you do not have to rebuild save wil do, changes made in server side code, you need to rebuild the solution
using System; using System.Collections; using System.Configuration; using System.Data; using System.Text; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using NopSolutions.NopCommerce.Common; using NopSolutions.NopCommerce.Common.Configuration.Settings; using NopSolutions.NopCommerce.Common.Promo.Affiliates; using NopSolutions.NopCommerce.Common.SEO; using NopSolutions.NopCommerce.Common.Utils; using NopSolutions.NopCommerce.Common.CustomerManagement;
namespace NopSolutions.NopCommerce.Web { public partial class ThreeColumn : BaseNopMasterPage { protected override void OnLoad(EventArgs e) { base.OnLoad(e); } } }
[/quote]
Appreciate your help. I still couldn't find where I've missed some codes.