Sign in Registration
ruen

Content

Table of contents

This entity allows you to manage the materials in the system and their types. It is included in the core of the system and provides for the creation, editing and deletion of content - it includes the necessary tools for convenient creation of new publications. The main page is shown below:

content

  • Add - link to the add page;
  • Types - link to the content types management page;
  • Navigation - links to broken pages;
  • Title - displayed title;
  • Type - material type;
  • Actions - links for editing and deleting are available.

The administration page displays all entries that have been added by users of the system. When you click on the title of the material, you go to the corresponding page.

Adding a material, selecting its type (previously created material types):

content-add-type

Adding material, main form (fields may vary depending on the type of material):

content-add

  • Title - displayed title of the material, on its basis the address for this material can be generated (for this, the corresponding checkbox must be set, and Cyrillic characters are transliterated into Latin characters);
  • Address for material - address for material;
  • Content - the content of the material.

After filling in the fields, you must click on the submit button of the form, as a result of which the system will start the validation process - if any values ​​in the fields are invalid, a warning will be displayed with the name of the fields that contain invalid values. In case of successful verification, the material will be added - the newly created page will open. If necessary, you can click on the "Edit" link under the title to edit the page you are viewing.

Manage content types page:

content-types

  • Add - link to the page for adding a content type;
  • Content - link to content management page;
  • Name - machine name of material type;
  • Title - displayed title;
  • Actions - links for setting, changing and deleting are available (in this case, all elements dependent on it will be deleted: materials, fields, field data).

Page for adding a content type (similarly for editing):

content-types-add

  • Name - machine name of material type;
  • Title - Display title.

Templates

By default, templates are not used for display, 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 different views. For any type of material, you can create a template that will be used when displaying this type of material.

Templates must be placed in the current theme folder at "/custom/themes/*/templates", where * is the name of the theme. The template must have a name like "content_show_*.tpl", where * is the name of the content type.

Here are the following values:

  • content - belonging to the "Content" entity;
  • show - action to perform;
  • material type name is the name given to the type.

It is enough to create a similar template in the above directory and it will automatically be used when displaying a certain type of material. In the template, you can place the fields as you like, which allows you to draw the output in the desired form. It has an array "data" that 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 return to using standard output, you just need to delete the generated template.

Latest articles

Popular sections

Eqsash (Tools)

Android app - VK LAST USER ID, отучитель от зависимости и т.д.:
Available on Google Play

Amessage (Communication)

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

Share this

Subscribe to

YouTube

Books

IT notes - In simple language about the most necessary things (HTML, CSS, JavaScript, PHP, databases, Drupal, Bitrix, SEO, domains, security and more), PDF, 500 p.