-
-
Notifications
You must be signed in to change notification settings - Fork 9
Task 1 Categories
The default display for Extensions Directory is a list of category headings with totals of sub categories.
In JED 3 it looks like this:

In the JED 4 prototype it looks like this:

Once a category is selected a list of extensions is displayed.
This is JED 3

This is JED 4

The CSS Styling needs refining/redesigning.
The CSS will need to be added to media/com_jed/css and joomla.asset.json and respective webassist call and html / css updated in components/com_jed/tmpl/categories/default.php for top-level categories and in
components/com_jed/tmpl/category/default.php for category/list of extensions.
This is an example of $this->items for top-level categories. Each category is stored as an indexed array sorted by number of children descending.
Array
(
[Miscellaneous] => stdClass Object
(
[extension] => com_jed
[title] => Miscellaneous
[alias] => miscellaneous
[slug] => 9:miscellaneous
[parent_id] => root
[id] => 9
[children] => Array
(
[Fake data] => stdClass Object
(
[extension] => com_jed
[title] => Fake data
[alias] => fake-data
[slug] => 264:fake-data
[parent_id] => 9
[id] => 264
[children] => Array
(
)
[numitems] => 19
)
[Mass Content] => stdClass Object
(
[extension] => com_jed
[title] => Mass Content
[alias] => mass-content
[slug] => 50:mass-content
[parent_id] => 9
[id] => 50
[children] => Array
(
)
[numitems] => 16
)
[Tutorials] => stdClass Object
(
[extension] => com_jed
[title] => Tutorials
[alias] => tutorials
[slug] => 250:tutorials
[parent_id] => 9
[id] => 250
[children] => Array
(
)
[numitems] => 11
)
[Offline] => stdClass Object
(
[extension] => com_jed
[title] => Offline
[alias] => offline
[slug] => 291:offline
[parent_id] => 9
[id] => 291
[children] => Array
(
)
[numitems] => 9
)
[Miscellaneous Bridges] => stdClass Object
(
[extension] => com_jed
[title] => Miscellaneous Bridges
[alias] => miscellaneous-bridges
[slug] => 213:miscellaneous-bridges
[parent_id] => 9
[id] => 213
[children] => Array
(
)
[numitems] => 7
)
[Development] => stdClass Object
(
[extension] => com_jed
[title] => Development
[alias] => development
[slug] => 93:development
[parent_id] => 9
[id] => 93
[children] => Array
(
)
[numitems] => 4
)
)
[numitems] => 16
)
[Migration & Conversion] => stdClass Object
(
[extension] => com_jed
[title] => Migration & Conversion
[alias] => migration-conversion
[slug] => 37:migration-conversion
[parent_id] => root
[id] => 37
[children] => Array
(
[Joomla Migration] => stdClass Object
(
[extension] => com_jed
[title] => Joomla Migration
[alias] => joomla-migration
[slug] => 202:joomla-migration
[parent_id] => 37
[id] => 202
[children] => Array
(
)
[numitems] => 14
)
[Data Import & Export] => stdClass Object
(
[extension] => com_jed
[title] => Data Import & Export
[alias] => data-import-export
[slug] => 48:data-import-export
[parent_id] => 37
[id] => 48
[children] => Array
(
)
[numitems] => 10
)
[Users Import & Export] => stdClass Object
(
[extension] => com_jed
[title] => Users Import & Export
[alias] => users-import-export
[slug] => 203:users-import-export
[parent_id] => 37
[id] => 203
[children] => Array
(
)
[numitems] => 9
)
[Extensions Migration] => stdClass Object
(
[extension] => com_jed
[title] => Extensions Migration
[alias] => extensions-migration
[slug] => 201:extensions-migration
[parent_id] => 37
[id] => 201
[children] => Array
(
)
[numitems] => 8
)
)
[numitems] => 14
)
)To loop through the items, we use
foreach ($this->items as $c) :
echo $c->title;
echo $c->numitems;
foreach ($c->children as $sc) {
echo $sc->title;
echo $sc->numitems;
}
endforeach;To create a link to the parent category we can use
echo Route::_('index.php?option=com_jed&view=category&id=' . $c->id);or for the child category
echo Route::_('index.php?option=com_jed&view=category&id=' . $sc->id);This is an example of $this->items for a category detail, it's basically just a list of extensions within the selected category. Each extension is stored as an array. Remember that in JED 4 each extension can have varied data depending on its supply type, i.e. Free Version / Paid Version. The data below is the 'parent' extension details that in turn can have variations.
Array
(
[0] => stdClass Object
(
[id] => 284
[joomla_versions] => ["40"]
[popular] => 0
[requires_registration] => 0
[gpl_license_type] => LGPL
[jed_internal_note] =>
[can_update] => 1
[video] => https://player.vimeo.com/external/322748791.hd.mp4?s=154744912cc43f66847bd9aa7658c3dc4b1bd180&profile_id=175&oauth2_token_id=57447761
[version] => 4
[uses_updater] => Yes
[includes] => ["com"]
[approved] => 1
[approved_time] => 2023-05-01 08:23:35
[second_contact_email] => [email protected]
[jed_checked] => 1
[uses_third_party] => 1
[primary_category_id] => 50
[logo] => https://extensions.joomla.org/cache/fab_image//images/jed_logos/8833ebd394d6525f1a45bd73517d82ec_resizeDown400px175px16.png
[approved_notes] => All good
[approved_reason] => All good
[published_notes] =>
[published_reason] =>
[published] => 1
[checked_out] => 0
[checked_out_time] =>
[created_by] => 221
[modified_by] => 221
[created_on] => 2023-04-19 10:59:18
[modified_on] => 2023-04-19 10:59:18
[state] => 1
[category_title] => Mass Content
[uEditor] =>
[developer] => Jacob Hernandez
[description] => She said this she looked up and repeat "'TIS THE VOICE OF THE SLUGGARD,"' said the Caterpillar. 'Well, perhaps you were down here with me! There are no mice in the wood, 'is to grow larger again.
[title] => Quaint Entrance
[alias] => quaint-entrance
[category_hierarchy] =>
Miscellaneous
•
Mass Content
[scores] => Array
(
[0] => stdClass Object
(
[id] => 223
[extension_id] => 284
[supply_option_id] => 1
[functionality_score] => 60
[ease_of_use_score] => 58
[support_score] => 57
[value_for_money_score] => 50
[documentation_score] => 67
[number_of_reviews] => 7
[state] => 1
[ordering] => 0
[checked_out] =>
[checked_out_time] =>
[created_by] =>
[modified_by] =>
)
)
[number_of_reviews] => 7
[type] => Free
[score] => 58
[score_string] =>
[review_string] => 7 reviews
)
[1] => stdClass Object
(
[id] => 103
[joomla_versions] => ["30","40"]
[popular] => 0
[requires_registration] => 0
[gpl_license_type] => LGPL
[jed_internal_note] =>
[can_update] => 1
[video] => https://player.vimeo.com/external/456092942.sd.mp4?s=3e8135913c79aadaf3bda70a4319577b3e26fc38&profile_id=165&oauth2_token_id=57447761
[version] => 3 4
[uses_updater] => Yes
[includes] => ["com"]
[approved] => 1
[approved_time] => 2023-04-21 16:12:56
[second_contact_email] => [email protected]
[jed_checked] => 1
[uses_third_party] => 1
[primary_category_id] => 50
[logo] => https://extensions.joomla.org/cache/fab_image//images/jed_logos/b2186934b4841c3d65edb1dfb2f539a4_resizeDown400px175px16.png
[approved_notes] => All good
[approved_reason] => All good
[published_notes] =>
[published_reason] =>
[published] => 1
[checked_out] => 0
[checked_out_time] =>
[created_by] => 145
[modified_by] => 145
[created_on] => 2023-04-19 10:59:18
[modified_on] => 2023-04-19 10:59:18
[state] => 1
[category_title] => Mass Content
[uEditor] =>
[developer] => William Smith
[description] => I goes like a writing-desk?' 'Come, we shall get on better.' 'I'd rather not,' the Cat went on, 'What HAVE you been doing here?' 'May it please your Majesty,' said Alice timidly. 'Would you tell.
[title] => Wiry Screen
[alias] => wiry-screen
[category_hierarchy] => Miscellaneous
Mass Content
[scores] => Array
(
[0] => stdClass Object
(
[id] => 89
[extension_id] => 103
[supply_option_id] => 1
[functionality_score] => 83
[ease_of_use_score] => 87
[support_score] => 57
[value_for_money_score] => 42
[documentation_score] => 60
[number_of_reviews] => 1
[state] => 1
[ordering] => 0
[checked_out] =>
[checked_out_time] =>
[created_by] =>
[modified_by] =>
)
)
[number_of_reviews] => 1
[type] => Free
[score] => 65
[score_string] =>
[review_string] => 1 review
)
}To loop through the items, we use
foreach ($this->items as $e) :
echo $e->title;
echo $e->developer;
endforeach;