Sign in Registration

Content component

Table of contents

The "Content" component, as its name suggests, is required to manage content in the system. It is included in the core of the system and provides the creation, editing and deletion of content on the site . The component includes all the necessary tools for easy creation of new publications, including a visual editor that can be turned on at will. To go to the component management page, from the main administration page, click the "Content" link in the "Core" block.

Контент сайта, список

The "Content" administration page displays all records that have been added by users of the system. When you click on the title of the material, you go to the corresponding page. The type and links for deleting and editing the selected site content are indicated next to the name.

By default, no material type has been created in the system, therefore, first of all, you must create at least one type. To add a new type, click on the "Types of materials" link, the page for managing the types of materials will open.

Контент сайта, список типов

Next, click "Add Material Type". The form for adding a new type will be shown, where you must enter the system and common name. The system name is used by the system, while the regular name can be used to display to the user.

Контент, добавить тип материала

After adding a type, a message will be displayed about the successful completion of the add operation and the new type will be displayed on the content types administration page.

Контент, список типов материалов

After completing the operation of adding a material type, you can immediately proceed to adding a new page on the site. Basic fields will be provided to fill out. In addition, additional fields can be created and configured for any type. To do this, click on the "customize fields" link on the content types management page. A type can be deleted, and all its dependent elements will be deleted: materials, fields, field data. To edit a type, click on the "edit" link.

To add a new entry, click on the "Add material" link - a page with the ability to select the required type will be opened. The type of the created page determines how the forms for adding and editing a page of the selected type will look, as well as how it will be displayed and used by other system components.

Создание контента 1

After selecting the type, the direct creation page will open. Fields available by default: "Title", "Address for material", "Content". Required fields are marked with asterisks.

Создание контента 2

In the Title field, enter the desired page title. On the basis of this heading, an address for this page can be generated, for this, a tick must be checked under "Create address automatically", while transliteration of Cyrillic characters into Latin takes place. Otherwise, uncheck the box, the field will become available for entering values ​​into it, and enter the desired address yourself. The Content field is a direct field for entering future page content.

After filling in all the required fields, click on the "Save" button, as a result of which the system will start the validation process, and if any values ​​in the fields are invalid, it will display a warning with the name of the field in which such values ​​are present. If the check is successful, the page will be added and the system will inform you about it as an informational message. This will open the page you just created. If necessary, you can click on the "Edit" link under the heading to go to editing the viewed page. The edit page is almost the same as the create page. An edit link is also available on the main content administration page.

Список типов контента

To delete pages, use the "delete" link opposite the desired item in the list of all items. Before deleting, you must confirm this action, which excludes accidental deletion.

By default, no templates are used for display, the content is displayed in a standard form. It is often necessary to be able to flexibly customize the output of a certain type of content, namely, to place fields in different places on the page and in a different presentation. For any type of content, you can create a template that will be used when displaying content of this type. Templates should be placed in the current theme folder at "/ themes / your_theme_name / templates". The template must have a name like "content_show_material_type_name.tpl". Here “content” means that the template belongs to the “Content” component, “show” is the action to be performed, the name of the content type is the name that was assigned to the type. You just need to create a similar template in the above directory and it will automatically be used when displaying content of a certain type. In the template, you can place the fields as you like, which allows you to draw the output in the desired form. The array "data" is available in it, which contains all the data available for the page. You can view its contents, for example, using the "print_r" function and use the desired values. All features of the PHP programming language are also available in the template. To revert to using standard output, simply delete the generated template.

Latest articles

Popular sections


Login to the web version
Android app:
Available on Google Play

Share this

Subscribe to