Remove table elements

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Can anyone tell me how to remove the table elements from a category list?

I'm using the HomePageCategories.chhtml as an over ride in my own theme.

This peice of code  @(Html.DataList<CategoryModel>(Model, 4,

is adding the <table><tr><td> to each category in the list, however I want the table removed, so i can just use my original markup.

Thanks in advance!!!
12 years ago
Edit the HomePageCategories.chhtml view and change the following code:
@(Html.DataList<CategoryModel>(Model, 3,
    @<div class="item-box">
        <div class="category-item">
            <h2 class="title">
                <a href="@Url.RouteUrl("Category", new { categoryId = item.Id, SeName = item.SeName })" title="@item.PictureModel.Title">
                    @item.Name</a>
            </h2>
            <div class="picture">
                <a href="@Url.RouteUrl("Category", new { categoryId = item.Id, SeName = item.SeName })" title="@item.PictureModel.Title">
                    <img alt="@item.PictureModel.AlternateText" src="@item.PictureModel.ImageUrl"
                        title="@item.PictureModel.Title" /></a>
            </div>
        </div>
    </div>
))


to:
@foreach (var item in Model)
{
    <div class="item-box">
        <div class="category-item">
            <h2 class="title">
                <a href="@Url.RouteUrl("Category", new { categoryId = item.Id, SeName = item.SeName })" title="@item.PictureModel.Title">
                    @item.Name</a>
            </h2>
            <div class="picture">
                <a href="@Url.RouteUrl("Category", new { categoryId = item.Id, SeName = item.SeName })" title="@item.PictureModel.Title">
                    <img alt="@item.PictureModel.AlternateText" src="@item.PictureModel.ImageUrl"
                            title="@item.PictureModel.Title" /></a>
            </div>
        </div>
    </div>
}
.
12 years ago
Ideal thanks for the reply.

I'm having the same problem with the _Product Box.cshtml as well but it doesnt use any code surrounding the html.

I'm also trying to pull in the price into this file but without success.

I understand I can swith useSmallProductBox off in the configuration but this pulls in a table also. with only two columns.

So is there a way of removing the tables automatically added altogether?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.