Register
Log in
Shopping Cart
(
0
)
Home
Product
Overview
Features
Store demo
Showcase - live shops
Copyright notice removal
System requirements
Roadmap
Contribute
License
Downloads
Download nopCommerce
Extensions and themes
Release notes
Support
Documentation
Community forums
Premium support
Request a quote
Partners
Recommended hosting
Solution partners
Become a partner
My Account
Contacts
Users online
702
Home
>
Forums
>
General
>
Development
>
Remove style info from cshtml?
Remove style info from cshtml?
Reply
blytha
Total Posts:
11
Karma:
55
Joined:
8/2/2010
Location:
United Kingdom
PM
Posted:
one year ago
Quote
#67269
Would it be possible to remove the style information from the cshtml so that we can use CSS to change styles. I have an example below.
Replace
CategoryNavigation.cshtml
with the code between the hashes and then uss CSS to alter margins.
e.g.
##############################################
@model IList<CategoryNavigationModel>
@using Nop.Core.Domain.Catalog
@using Nop.Core.Infrastructure
@using Nop.Services.Catalog
@using Nop.Web.Models.Catalog
@if (Model.Count > 0)
{
<div class="block block-category-navigation">
<div class="title">
@T("Categories")
</div>
<div class="clear">
</div>
<div class="listbox">
<ul>
@foreach (var category in Model)
{
<li
@if (this.ShouldUseRtlTheme())
{
<text>class="@(category.IsActive ? "active" : "inactive") navigationlevelright@(category.NumberOfParentCategories)"</text>
}
else
{
<text>class="@(category.IsActive ? "active" : "inactive") navigationlevel@(category.NumberOfParentCategories)"</text>
}
><a href="@Url.RouteUrl("Category", new { categoryId = category.Id, SeName = category.SeName })">@category.Name
@if (category.DisplayNumberOfProducts)
{
<text> (@(category.NumberOfProducts))</text>
}
</a></li>
}
</ul>
</div>
</div>
}
##############################################
and style
.block .listbox ul li.
navigationlevel0
a
{
font-size:1.2em;
font-weight:bold;
}
.block .listbox ul li.navigationlevel1 a
{
padding-left:27px;
font-weight:bold;
padding-top:3px;
padding-bottom:3px;
color: rgb(255, 255, 192);
}
cheers,
Anthony
0
Please
login or register
to vote for this post.
(click on this box to dismiss)
See my Nop Site at http://www.artificiallawn.co.uk
a.m.
Total Posts:
8948
Karma:
69572
Joined:
10/22/2008
Location:
Russia
PM
Posted:
one year ago
Quote
#67278
It could be done if we knew the maximum number of such navigation levels. Have many such styles should we create?
0
Please
login or register
to vote for this post.
(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx
Best Regards,
Andrei Mazoulnitsyn
blytha
Total Posts:
11
Karma:
55
Joined:
8/2/2010
Location:
United Kingdom
PM
Posted:
one year ago
Quote
#67299
Thanks for responding.
In response, there is already a limit imposed by adding 15px per parent. I had three level in my design and this was wider than the menu. The proposed implementation allows you to use as many as you like and is not limited by width in the same way as the current imlementation, as I can set the margin-left or right to 5px if I want.
As to the number of levels, I created 6 even though I will only be using three.
cheers,
Anthony
0
Please
login or register
to vote for this post.
(click on this box to dismiss)
See my Nop Site at http://www.artificiallawn.co.uk
a.m.
Total Posts:
8948
Karma:
69572
Joined:
10/22/2008
Location:
Russia
PM
Posted:
one year ago
Quote
#67309
I think there should another more elegant solution. I'll think about it.
0
Please
login or register
to vote for this post.
(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx
Best Regards,
Andrei Mazoulnitsyn
blytha
Total Posts:
11
Karma:
55
Joined:
8/2/2010
Location:
United Kingdom
PM
Posted:
one year ago
Quote
#67425
Hi,
That may be so, but using css is more elegant than hard coded styles?!?!
Thanks for reading.
0
Please
login or register
to vote for this post.
(click on this box to dismiss)
See my Nop Site at http://www.artificiallawn.co.uk