How to hide category and Manufacture and information columns from master page..?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi.,

How to hide category and Manufacture and information columns from master page..?i too tried to change in _ColumnThree.cshtml file but it wont reflected in any where... i wants that those menus are not shown in home page or any where else... Is there any option to hide those (category,Manufacture,information and popular tags) columns from master page in the ADMIN part..? did we have any option to make it on admin part by doing any settings..? i am using nopcommerce2.60 version...

Thanks in advance....
11 years ago
create an override over ~/views/home/index.cshtml by copying to your theme folder.

Next add this code:

@section left {
PUT THE STUFF HERE YOU WANT OR NOTHING AT ALL :-)
}


The whole of the left bar will be replaced with the contents of @section left
11 years ago
Hi Keesjan..

Thanks allot for ur immediate response... I am very new to nopcommerce and asp.net MVC3 too..
Can u pls explain me little briefly..? bcz i too tried as u mentioned but wont get any reflection.. i tried by clear cache also., but no use.. then i don't know how and were to add the theme folder as u mentioned... below i attached the source code of Index.cshtm(~/views/home/index.cshtml)., pls correct my mistake and guide me to get the correct it. if u give any video like means also its very useful for all...

Thanks in advance.


@{
    Layout = "~/Views/Shared/_ColumnsThree.cshtml";
}
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_top" })
@Html.Action("TopicBlock", "Topic", new { systemName = "HomePageText" })
<div class="clear">
</div>
@Html.Action("HomepageCategories", "Catalog")
<div class="clear">
</div>
@Html.Action("HomepageProducts", "Catalog")
<div class="clear">
</div>
@Html.Action("HomepageBestSellers", "Catalog")
<div class="clear">
</div>
@Html.Action("HomePageNews", "News")
<div class="clear">
</div>
@section left {

        This content will be rendered as a left column.
        If you remove this section,
        the page will automatically adapt to having no left column.
}
@Html.Action("HomePagePolls", "Poll")
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_bottom" })
11 years ago
if you made any changes to _ColumnsThree.cshtml undo them.

Let's assume you are using the nopClassic theme.

In your solution folder goto project nop.web and then navigate to /themes/nopClassic/Views
In the Views folder create folder 'Home'. Next copy /views/home/index.cshtml from nop.web
to the 'Home' folder you just created. Now change the copied index.cshtml to:


@{
    Layout = "~/Views/Shared/_ColumnsThree.cshtml";
}
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_top" })
@Html.Action("TopicBlock", "Topic", new { systemName = "HomePageText" })
<div class="clear">
</div>
@Html.Action("HomepageCategories", "Catalog")
<div class="clear">
</div>
@Html.Action("HomepageProducts", "Catalog")
<div class="clear">
</div>
@Html.Action("HomepageBestSellers", "Catalog")
<div class="clear">
</div>
@Html.Action("HomePageNews", "News")
<div class="clear">
</div>
@Html.Action("HomePagePolls", "Poll")
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_bottom" })

@section left {
    This is the left side...
}


Rebuild your solution.
11 years ago
Hi Keesjan..

Again Thanks allot..i did all as u said.,then rebuilds the application and clears the cache too.., but i wont get Any of the changes to hide those parts in left side column.. i wont did any changes in _ColumnsThree.cshtml too...

here is the code of index.cshtml in  /themes/nopClassic/Views  folder...

@{
    Layout = "~/Views/Shared/_ColumnsThree.cshtml";
}
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_top" })
@Html.Action("TopicBlock", "Topic", new { systemName = "HomePageText" })
<div class="clear">
</div>
@Html.Action("HomepageCategories", "Catalog")
<div class="clear">
</div>
@Html.Action("HomepageProducts", "Catalog")
<div class="clear">
</div>
@Html.Action("HomepageBestSellers", "Catalog")
<div class="clear">
</div>
@Html.Action("HomePageNews", "News")
<div class="clear">
</div>
@Html.Action("HomePagePolls", "Poll")
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_bottom" })


@section left {
    This is the left side...
}


then this is the code of ordinary index.cshtml file in /views/home folder...

@{
    Layout = "~/Views/Shared/_ColumnsThree.cshtml";
}
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_top" })
@Html.Action("TopicBlock", "Topic", new { systemName = "HomePageText" })
<div class="clear">
</div>
@Html.Action("HomepageCategories", "Catalog")
<div class="clear">
</div>
@Html.Action("HomepageProducts", "Catalog")
<div class="clear">
</div>
@Html.Action("HomepageBestSellers", "Catalog")
<div class="clear">
</div>
@Html.Action("HomePageNews", "News")
<div class="clear">
</div>
@Html.Action("HomePagePolls", "Poll")
@Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_bottom" })


then this is the ccode in _ColumnsThree.cshtml :-

@{
    Layout = "~/Views/Shared/_Root.cshtml";
}
@{
    
    //current category ID
    int currentCategoryId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("category", StringComparison.InvariantCultureIgnoreCase))
    {
        currentCategoryId = Convert.ToInt32(Url.RequestContext.RouteData.Values["categoryId"].ToString());
    }


    //current manufacturer ID
    int currentManufacturerId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("manufacturer", StringComparison.InvariantCultureIgnoreCase))
    {
        currentManufacturerId = Convert.ToInt32(Url.RequestContext.RouteData.Values["manufacturerId"].ToString());
    }


    //current product ID
    int currentProductId = 0;
    if (Url.RequestContext.RouteData.Values["controller"].ToString().Equals("catalog", StringComparison.InvariantCultureIgnoreCase) &&
        Url.RequestContext.RouteData.Values["action"].ToString().Equals("product", StringComparison.InvariantCultureIgnoreCase))
    {
        currentProductId = Convert.ToInt32(Url.RequestContext.RouteData.Values["productId"].ToString());
    }
}
<div class="master-wrapper-leftside-3">
    @if (IsSectionDefined("left"))
    {
        @RenderSection("left")
    }
    else
    {
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "left_side_column_before" })
        <div class="clear">
        </div>
        @Html.Action("CategoryNavigation", "Catalog", new { currentCategoryId = currentCategoryId, currentProductId = currentProductId })
        <div class="clear">
        </div>
        @Html.Action("ManufacturerNavigation", "Catalog", new { currentManufacturerId = currentManufacturerId })
        <div class="clear">
        </div>
        @Html.Action("PopularProductTags", "Catalog")
        <div class="clear">
        </div>
        @Html.Action("InfoBlock", "Common")
        <div class="clear">
        </div>
        @Html.Action("PollBlock", "Poll", new { systemKeyword = "LeftColumnPoll" })
        <div class="clear">
        </div>
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "left_side_column_after" })
    }
</div>
<div class="master-wrapper-center-3">
    <div class="master-wrapper-cph-3">        
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "main_column_before" })
        @RenderBody()
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "main_column_after" })
    </div>
</div>
<div class="master-wrapper-rightside-3">
    @if (IsSectionDefined("right"))
    {
        @RenderSection("right")
    }
    else
    {
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "right_side_column_before" })
        <div class="clear">
        </div>
        @Html.Action("NewsletterBox", "Newsletter")
        <div class="clear">
        </div>
        @Html.Action("RecentlyViewedProductsBlock", "Catalog")        
        <div class="clear">
        </div>        
        @Html.Action("PollBlock", "Poll", new { systemKeyword = "RightColumnPoll" })
        <div class="clear">
        </div>
        @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "right_side_column_after" })
    }
</div>


pls guide me to resolve the issue...

Thanks in advance...
11 years ago
you did set your theme to be nopClassic?
11 years ago
sssssss., i set the theme as Nopclassic.... then i added that home folder and index.cshtml file in Orange theme also... but no use..
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.