templates in 2.0 for products, categories & manufacturers

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
hallo all, i read this topic and after read 2.2 features from official site: (Added category and manufacturer templates.)

I don't find possibilities, how was on 1.6, to select product il line templates for a specific category!! what i have to do?

thanks
12 years ago
cris81 wrote:
hallo all, i read this topic and after read 2.2 features from official site: (Added category and manufacturer templates.)

I don't find possibilities, how was on 1.6, to select product il line templates for a specific category!! what i have to do?

2.2 contains only one category template which allows customers to choose preferred view. If you want to display inline only, then create a new category template (modify existing one) and add an appropriate record into [CategoryTemplate] table.
12 years ago
i'm not good with coding .net

someone can help me to modify template?

is this that i have to modify?

@*product list*@
    @if (Model.Products.Count > 0)
    {
        if (Model.PagingFilteringContext.ViewMode == "list")
        {
            @*list mode*@
            <div class="product-list">
            @foreach (var product in Model.Products)
            {
                <div class="item-box">
                    @Html.Partial("_ProductBox", product)
                </div>
            }
            </div>      
        }
        else
        {
            @*grid mode*@
            <div class="product-grid">
                @(Html.DataList<ProductModel>(Model.Products, 2,
                    @<div class="item-box">
                        @Html.Partial("_ProductBox", @item)
                    </div>
                ))
            </div>
        }
    }

in what?

thanks
12 years ago
solved modifing code in this

------------------------


    @*product list*@
    @if (Model.Products.Count > 0)
  
        {
            @*list mode*@
            <div class="product-list">
            @foreach (var product in Model.Products)
            {
                <div class="item-box">
                    @Html.Partial("_ProductBox", product)
                </div>
            }
            </div>      
        }
        else
        {
            @*grid mode*@
            <div class="product-grid">
                @(Html.DataList<ProductModel>(Model.Products, 2,
                    @<div class="item-box">
                        @Html.Partial("_ProductBox", @item)
                    </div>
                ))
            </div>
        }
  
    
            <div class="clear">
            </div>

----------------------
12 years ago
another question:


how i have to modify code to obtain a simple list of category items? someone like a ordered list?

thx
12 years ago
I understand that in the database there is a CategoryTemplates table and we can insert a new "View" to be used with the existing model ... I've even considered putting that view in a plugin.. but what is the "right" way to extend the way that categories are displayed?

I can edit CategoryController, modify the model to include new fields etc... and create a new View in Views (then point to the new view with category template.

I guess I'm curious which is the best way... Ideally I'd be able to make a plugin that overrides the normal category controller ... should I attempt to have a plugin's routing override?

I'm concerned about new updates after I've started customizing code. trying to write everything as plugin so that new versions compatibility issues are minimized
12 years ago
cris81 wrote:
solved modifing code in this

------------------------


    @*product list*@
    @if (Model.Products.Count > 0)
  
        {
            @*list mode*@
            <div class="product-list">
            @foreach (var product in Model.Products)
            {
                <div class="item-box">
                    @Html.Partial("_ProductBox", product)
                </div>
            }
            </div>      
        }
        else
        {
            @*grid mode*@
            <div class="product-grid">
                @(Html.DataList<ProductModel>(Model.Products, 2,
                    @<div class="item-box">
                        @Html.Partial("_ProductBox", @item)
                    </div>
                ))
            </div>
        }
  
    
            <div class="clear">
            </div>

----------------------


why if i apply this template at the last category order product in line and if i apply to parent category not work? what i miss?
12 years ago
it's possiblo to do in manufacturer category?
11 years ago
Old post but I have a related question.

I've merged the two product templates into one, that handles both single and multiple variants. So moving forward all products will use my new template.

What's the right way to "hide" or "delete" the one I don't want so that all new products default to my new template?

(I was able to delete it from the database table, but I did not know if there was a way to do it thru the interface.)
11 years ago
Currently, the only way to modify a product template record is by modifying the entry in the database table ProductTemplate. Instead of deleting the entry you don't want, you can adjust the display orders so the one you want to be the default choice has a lower value (will be displayed first in the list).

.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.