igor_k Posted March 30, 2012 Report Share Posted March 30, 2012 Подскажите пожалуйста, как и где я могу добавить дополнительное текстовое поле для категории? Quote Link to post Share on other sites
Kpoxa Posted March 30, 2012 Report Share Posted March 30, 2012 1. Создать в БД поле.2. Добавить обработку поля в движке.3. Добавить вывод этого поля в админке и шаблоне. Quote Link to post Share on other sites
igoryk Posted March 31, 2012 Report Share Posted March 31, 2012 Мозгом это понятно, а как технически реализовать - для "чайников" так сказать ... Quote Link to post Share on other sites
arsko Posted March 31, 2012 Report Share Posted March 31, 2012 Тема просто обжована. Quote Link to post Share on other sites
igoryk Posted April 1, 2012 Report Share Posted April 1, 2012 /arsko / если обжована, то дайте ссылку - где .. Quote Link to post Share on other sites
arsko Posted April 2, 2012 Report Share Posted April 2, 2012 Учитесь работать поиском. Тут реально много об этом говорилось. Quote Link to post Share on other sites
Enhill Posted April 3, 2012 Report Share Posted April 3, 2012 Создаем в бд нужную нам колонку: ALTER TABLE s_categories ADD description_two text AFTER description;Добавляется колонка description_two после колонки descriptionВключаем обработку движка:api\Catigories.php примерно 160 строкаМеняем $query = $this->db->placehold("SELECT id, parent_id, name, description, url, meta_title, meta_keywords, meta_description, image, visible, position FROM __categories ORDER BY parent_id, position"); На // Выбираем все категории $query = $this->db->placehold("SELECT id, parent_id, name, description, description_two, url, meta_title, meta_keywords, meta_description, image, visible, position FROM __categories ORDER BY parent_id, position");Включаем поле в админке:simpla\CategoryAdmin.php примерно 27 строкаПосле$category->description = $this->request->post('description');Добавляем с новой строки$category->description_two = $this->request->post('description_two');simpla\design\html\category.tpl примерно 225 строкаПосле<div class="block layer"> <h2>Описание</h2> <textarea name="description" class="editor_large">{$category->description|escape}</textarea> </div>Добавляем с новой строки<div class="block layer"> <h2>Описание2</h2> <textarea name="description_two" class="editor_large">{$category->description_two|escape}</textarea> </div>Включаем в основной шаблон:design\default\html\products.tplВставляем в любое нужное место {$category->description_two} Quote Link to post Share on other sites
igoryk Posted April 4, 2012 Report Share Posted April 4, 2012 /Enhill/ спасибо ЧЕЛОВЕЧИЩЕ !!! Quote Link to post Share on other sites
igor_k Posted April 4, 2012 Author Report Share Posted April 4, 2012 Enhill - СПАСИБО!!! Quote Link to post Share on other sites
zodiak92 Posted April 19, 2012 Report Share Posted April 19, 2012 Enhill спасибо Quote Link to post Share on other sites
zlodiak Posted June 4, 2013 Report Share Posted June 4, 2013 а не подскажет, как сделать то же самое для OrdersAdmin.php ? проблема в том, что в этом файле нет ничего подобного $category->description = $this->request->post('description'); Quote Link to post Share on other sites
anton_from_ip Posted June 23, 2013 Report Share Posted June 23, 2013 Огромное спасибо за инструкцию, очень помогла Quote Link to post Share on other sites
Dmitry86 Posted May 4, 2015 Report Share Posted May 4, 2015 Создаем в бд нужную нам колонку: ALTER TABLE s_categories ADD description_two text AFTER description;Добавляется колонка description_two после колонки description Включаем обработку движка:api\Catigories.php примерно 160 строкаМеняем $query = $this->db->placehold("SELECT id, parent_id, name, description, url, meta_title, meta_keywords, meta_description, image, visible, position FROM __categories ORDER BY parent_id, position");На // Выбираем все категории $query = $this->db->placehold("SELECT id, parent_id, name, description, description_two, url, meta_title, meta_keywords, meta_description, image, visible, position FROM __categories ORDER BY parent_id, position"); Включаем поле в админке:simpla\CategoryAdmin.php примерно 27 строка После $category->description = $this->request->post('description'); Добавляем с новой строки $category->description_two = $this->request->post('description_two'); simpla\design\html\category.tpl примерно 225 строка После <div class="block layer"> <h2>Описание</h2> <textarea name="description" class="editor_large">{$category->description|escape}</textarea> </div> Добавляем с новой строки <div class="block layer"> <h2>Описание2</h2> <textarea name="description_two" class="editor_large">{$category->description_two|escape}</textarea> </div> Включаем в основной шаблон:design\default\html\products.tpl Вставляем в любое нужное место {$category->description_two} Спасибо огромное, полезное дополнение! Подскажите, а для "Страниц" как такое сделать? Quote Link to post Share on other sites
shooroop Posted May 4, 2015 Report Share Posted May 4, 2015 Dmitry86 $category заменяете на $page и нужные поля обрабатываете s_pages api\Pages.php вообщем по аналогии Quote Link to post Share on other sites
Dmitry86 Posted May 4, 2015 Report Share Posted May 4, 2015 Dmitry86 $category заменяете на $page и нужные поля обрабатываете s_pages api\Pages.php вообщем по аналогииСпасибо большое и человеческое! Всё получилось! Quote Link to post Share on other sites
mistika Posted October 26, 2019 Report Share Posted October 26, 2019 Большое спасибо за тему, всё получилось. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.