Project

General

Profile

Feature #29

Implement common component to handle category tree display

Added by Vasily Bezruchkin about 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
Start date:
June 18, 2012
Due date:
% Done:

100%

Estimated time:

Description

Implement common component to handle categories tree. We have several packages that use categories - articles, listings, yellow pages listings, and more are coming. All of these packages have a side block that displays categories. We need to make a common component that would allow to display top level categories and display sub categories based on the parent value. It's possible it should be displayed in an accordion way using AJAX technique.

Please make it as easy as possible. Let's say in you smarty block you have:

{html_accordion cats=$article_categories url="articles/"}

You only implement php processing that returns subcategories. Of course, you should use common styles to display categories in a box.

History

#1

Updated by Vasily Bezruchkin about 8 years ago

  • Target version changed from 2.2.0 to 4.6.0
#2

Updated by Anonymous about 8 years ago

  • Status changed from New to Resolved

Feature is implemented.
Revision [2299].

Template of the smarty function:

{html_accordion name="TREE_NAME" category=$CATEGORY_ID json_url=$URL_TO_CATEGORIES_HANDLER}

Parameters:
TREE_NAME — a string that defines id of the tree's div.
$CATEGORY_ID — variable — stores id of the category that should be open on start up.
$URL_TO_CATEGORIES_HANDLER — URL to the file where php code returns json result with required categories.

The feature was applied for publishing package already. The changes can be seen in the files:
— packages/publishing/templates/admin/articles.tpl
— packages/publishing/templates/common/submit_article.tpl

#3

Updated by Anonymous about 8 years ago

  • Category set to Templates
  • Status changed from Resolved to In Progress
  • Assignee changed from Anonymous to Anonymous
  • Target version changed from 4.6.0 to 2.2.1
  • % Done changed from 0 to 50

The functionality was disabled for default categories selectors and enabled just for easy categories navigation.

Template of the smarty function:

{html_accordion name="TREE_NAME" category=$CATEGORY json_url=$URL_TO_CATEGORIES_HANDLER}

Parameters:
TREE_NAME — a string that defines id of the tree's div.
$CATEGORY_ID stores an array of elements (categorie's id and its parent id) of item to be open on start up.
$URL_TO_CATEGORIES_HANDLER — URL to the file where php code returns json result with required categories.

JavaScript file included to the core: js/intelli/intelli.accordion.js
Smarty file included to the core: templates/common/accordion.tpl

Need to be stylized for different templates.

#4

Updated by Anonymous about 8 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

Also available in: Atom PDF