fde60 Posted October 23, 2020 Share Posted October 23, 2020 hi, Per default, in PS 1.7, in detail product backoffice, the category tree is expand ! I want to reduce it on the start. in file @Product/ProductPage/Forms/form_categories.html.twig <div class="categories-tree js-categories-tree"> <fieldset class="form-group"> <div class="ui-widget"> <div class="search search-with-icon"> <input type="text" id="ps-select-product-category" class="form-control autocomplete search mb-1" placeholder="{{ 'Search categories'|trans({}, 'Admin.Catalog.Help') }}"> </div> <label class="form-control-label text-uppercase">{{ 'Associated categories'|trans({}, 'Admin.Catalog.Feature') }}</label> {{ include('@PrestaShop/Admin/Category/categories.html.twig', {'categories': categories }) }} {{ form_errors(form.id_category_default) }} {{ form_widget(form.id_category_default) }} <div class="categories-tree-actions js-categories-tree-actions"> <span class="form-control-label" id="categories-tree-expand"><i class="material-icons">expand_more</i>{{ "Expand"|trans({}, 'Admin.Actions') }}</span> <span class="form-control-label" id="categories-tree-reduce"><i class="material-icons">expand_less</i>{{ "Collapse"|trans({}, 'Admin.Actions') }}</span> </div> {{ form_widget(form.categories, {'defaultCategory': true}) }} {# see bootstrap_4_layout.html.twig #} </div> </fieldset> {{ form_errors(form.categories) }} {{ form_widget(form.categories) }} {# see bootstrap_4_layout.html.twig #} </div> where is the parameter to "say" it? Thank you Link to comment Share on other sites More sharing options...
fde60 Posted October 26, 2020 Author Share Posted October 26, 2020 up noone? Link to comment Share on other sites More sharing options...
fde60 Posted October 26, 2020 Author Share Posted October 26, 2020 ??? Link to comment Share on other sites More sharing options...
sney1984 Posted March 30, 2021 Share Posted March 30, 2021 FTP: /public_html/src/PrestaShopBundle/Resources/views/Admin/Product/ProductPage/product.html.twig Add this script at line 329: $(document).ready(function($) { if ($('#categories-tree-reduce').length) { $('#categories-tree-reduce').trigger('click'); } }); Link to comment Share on other sites More sharing options...
fde60 Posted March 30, 2021 Author Share Posted March 30, 2021 Super ! J'essaie ça prochainement Merci Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now