J4.x

Mise en route : Ajout d'une catégorie

From Joomla! Documentation

This page is a translated version of the page J4.x:Getting Started: Adding a Category and the translation is 10% complete.
Other languages:
Deutsch • ‎English • ‎Nederlands • ‎français • ‎português do Brasil • ‎日本語

Introduction

Les propriétaires de sites Web contenant plus d'une poignée d'articles doivent réfléchir à la meilleure façon de présenter le contenu pour faciliter la navigation. Par exemple, si vous avez un zoo, un musée, une collection de minéraux ou simplement un grand jardin, vous avez peut-être 1000 spécimens à décrire. Un article pour chaque spécimen, avec des photographies, nécessite une certaine structure organisationnelle. Si les articles étaient des fichiers, vous les placeriez probablement dans une hiérarchie de fichiers. Dans un CMS, les articles ne sont pas des fichiers, mais les catégories permettent une structure arborescente similaire. Exemple :

Category Sub-categories
Mammals Apes, Monkeys, Ungulates, Dogs, Cats
Reptiles Snakes, Lizards, Crocodiles, Turtles
Amphibians Frogs, Toads
Birds Raptors, Ducks, Gulls, Finches, Tits
Insects Spiders, Butterflies, Bees, Locusts
Fish Sharks, Salmon, Cod, Herring, Mackerel

Sub-categories may have further sub-categories too. An optimal number seems to be about seven.

Menu Item Types

There are two menu item types designed to work with Categories:

  • Category Blog. This is a page layout that has one or two leading article tasters, often full page width, then several more tasters in two or three columns, and finally a pagination mechanism to link to more articles in the same category. The taster is the content before the page-break. The Site Home page is a category blog that includes All Categories.
  • Category List. This is a list layout that displays a list of article titles in a category.

Create a Category

The article mentioned in this Getting Started series, My First Article, was a bit of an experiment. There may be more experiments so why not create an Experiments category? Proceed as follows:

  • Expand the Content item in the Administrator menu and select the + icon alongside the Categories menu item. Note that other components, such as Banners and Contacts, can have categories too. They are kept separate from Content Categories.
  • The Articles: New Category. form has only one compulsory field: the Title, in this case Experiments.
  • The Description. field is optional but it is best to fill it in as it used in some lists.
  • The Parent. field specifies whether this is category, -No Parent-, or a sub-category, selected from the list of categories.

J4.x-getting-started-category-screenshot-en.png

Save and Close! This takes you to the Articles: Categories list screen.

Change Article Category

  • Select the Articles item from the Administrator  Content menu.
  • Select the article title link the Title column to open the article for editing.
  • In the Category field select the Experiments category from the drop-down list.
  • Save and Close. There is no change in the Site Home page because the article is still marked as featured and the Home page is a category blog for All Categories.

Create Category List Menu Item

  • Select Menus  Main Menu  + from the Administrator menu to open the Menus: New Item form.
  • Select Articles  Category List in the Menu Item Type field.
  • Select Select  Experiments in the Choose a Category field.
  • Enter a Title, Experiments in this case.
  • Save and Close.

Go to the Site Home page and reload. Select the new Experiments menu item.

J4.x-getting-started-category-list-screenshot-en.png

Not too pretty at this stage but the layout can be improved. Later...