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.
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.
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.
- IT / Misc 08.07.21 How to make a free translation for a website without an API, translate documents in Google Translate
- IT / Misc 06.07.21 How to make a subscription button on a website, a subscriber base and automatic mailing
- Food / Misc 06.07.21 How to quickly cook delicious fried pies with potatoes and onions
- IT / Misc 04.07.21 Caching - create, load and reset. Where to store the cache, methods and types of caching
- IT / Database 03.07.21 Custom NoSQL - storing data in files and not only in a database. Storing settings, small data and caching files