Overlapping the main page in Drupal on your own. Overlapping the main page in Drupal on your own What is the difference between the types of materials

(Drupal) is a popular open source content management system. Due to its powerful functionality, developing complex sites with Drupal is much easier than writing them from scratch. It's no wonder that thanks to the large user community and the huge number of modules, we hear about Drupal more and more often.
In this tutorial, we will discover Drupal in practice and create a site with a new content type and pages to display it.
Ready? Dive into an exceptionally powerful content management system!

Objectives After reading this guide, you will:
  • learn about the advantages and disadvantages of Drupal;
  • install Drupal;
  • understand the principle of its work;
  • learn about Drupal modules;
  • learn how to work with administration pages;
  • create and publish website content;
  • customize your content type with CCK;
  • learn how to create views to render content using a module Views;
  • create paginated views;
  • create block-mapped views;
  • Learn about themes.
What we will do We will develop a website in Drupal with a job board where visitors can post jobs and projects. Our goal is to get you started building websites right away, not just reading how it's done. Why Drupal? First, let's take a quick look at the advantages (and disadvantages) of Drupal so that you can decide if this CMS is right for you. Advantages Open source. Yes, Drupal is distributed open source, which means that you have access to all the advantages of open source software.

Flexibility of configuration. The main advantage of Drupal lies in its flexible architecture. You can use it to build any type of site, from social media sites that allow users to post and vote on their own content, forums and job sites, to galleries or designer portfolio posts. Drupal will do an excellent job (of course, for this you will have to work a little).

Numerous and competent community of developers. Drupal has a large, vibrant and open community of users and developers around it. This means great modules, timely bug fixes and core updates, and an endless stream of documentation and tutorials online.

Modules. A huge number of modules have been developed for Drupal that expand its original functionality (we will talk about what a module is a little later).

Ease for developers. As a web developer, you won't feel restricted when working with Drupal. After all, Drupal was developed taking into account the needs of developers. The mistake of some major CMS is to overemphasize the user interface, which often leads to a lack of attention to the needs of those who, in fact, will develop and promote the system in the future. But this is not the case with Drupal.

Built-in caching system. Drupal has a built-in caching system that can reduce server load and reduce page generation time. Caching avoids complex database queries, which improves server performance.

Decent built-in search engine. Unlike other CMS, Drupal has a very good search engine implemented at the core level. Of course, it cannot compete with such search services as Google Search, or Yahoo! Search BOSS, but nevertheless quite suitable for work.

Disadvantages Long learning process. Yes, it is a fact that learning Drupal is somewhat more difficult than learning other CMS. I wouldn't recommend Drupal if you want to make your first website within a week of dating. It will take you more than one month to truly understand Drupal, and the same amount to create the first full-fledged website. However, it should be noted that you can create a small site in less than a day (which is what we will do with you in this guide).
Difficulty for non-developers. Since the needs of developers are at the forefront here, it will take some time for those who are not very familiar with information technology to get used to Drupal. This means that specialists who understand web development only superficially will find it difficult to create (or even administer) Drupal sites.
Complex interface. The site administration interface in Drupal is somewhat difficult to understand; overall it's not as user friendly as it could be. (That's about to change, though.) Drupal vs. WordPress Wherever Drupal is discussed, there's always an irresistible urge to compare it to another leading open source web platform; usually it is WordPress.
And wherever you suggest that WordPress is not a full-featured CMS, but just a blogging platform, there will always be a heated discussion waiting for you. I use both CMSs myself, but sometimes the power of WordPress just isn't enough.

In other words, if you are making a serious resource with registration, authentication, a set of permissions and roles, for example, an online store, a forum or a site with video and audio materials that users themselves add, it makes sense to use a more serious CMS than WordPress.
I wouldn't recommend you use Drupal if the client only wants a blog or a simple portfolio site with a few pages and basic content: these sites are faster and easier to make with WordPress. Drupal is clearly overkill for this.
Another important argument against using Drupal is the interface, which is not easy for inexperienced users to understand. This is a strong argument in favor of WordPress.

Sites Powered by Drupal To give you some encouragement, here are a few sites powered by Drupal.

Mozilla, the company responsible for Firefox, uses Drupal in almost all of its web projects. The official sites of Mozilla and Spread Firefox are made on Drupal. Download and install Drupal In this guide, we will use the latest stable release of Drupal 6; download it from here.

Installing Drupal on XAMPP Here we will install Drupal on our computer, but if you want to install it on a real server, the process is similar.
To install Drupal on a local machine, you will need a server platform such as XAMPP or WAMP. Don't be alarmed if you've never heard of them - they're very easy to use.
If you don't already have a local web server, install XAMPP now.
Below is a link to a simple guide by Jacob Gübe (Founder and Editor-in-Chief Six revisions), which will quickly install and configure XAMPP (the guide is written for WordPress, so follow only the first part of it, steps 1-26, keeping in mind that you are not installing WordPress, but Drupal):

For the remainder of this guide, we will assume that you are using XAMPP, so if you choose a different server package, you may need to modify the installation process a bit.
Copy Drupal files to XAMPP directory

Copy the Drupal package you downloaded earlier to the xampp\htdocs directory. Unzip the files and rename the folder to "drupal" for ease of navigation.
Now go to the xampp\htdocs\drupal\sites\default folder.

Create settings.php Make a copy of the default.settings.php file and rename it to settings.php.
Make sure you don't delete default.settings.php otherwise the Drupal installation will fail with an error; this is one of the most common mistakes made by novice Drupal developers.

Create a MySQL database Drupal uses to store data MySQL. So we need to set up the MySQL database in advance. To do this, we will use the web interface for convenient administration of MySQL databases (it is already included in the XAMPP distribution).
Go to the page in the browser by the address:
localhost/phpmyadmin

In this example, I named the base db_drupal. You can give the superuser ( root) all privileges to work with the database db_drupal, so that he can read, write and modify the data in the database. However, using a root account on a production site is not best practice. It is best to create a separate user for this database and give it only the necessary privileges. Now we will do just that.

Creating a separate MySQL user for the Drupal database In our example, I will create a new MySQL account and name it drupal_user. For production sites, however, it's a good idea to use a non-obvious, random username to reduce the chance of being hacked by a brute-force attack.
And definitely do not use the root account, as most hackers will try it first. The MySQL root user has super privileges and has access not only to your drupal_db database, but to other databases as well. (By the way, a good option is to remove the root user altogether and not use it anywhere. You can create a pseudo-root user, but more on that some other time).
To create a new MySQL user, go to the main phpMyAdmin page and then click on the "Privileges" tab.
Now click "Add a new user" and fill in the input fields with the required data.


As long as you are working on a local machine (that is, Drupal is installed on your machine and running on XAMPP), you can choose all the available privileges, but on the production server it is highly recommended to set only those that are really needed by the drupal_user.
For our example, I have selected only the privileges that I want to grant to the drupal_user user.

  • Select
  • Insert
  • update
  • Delete
  • Create
  • alter
  • Index
  • Create Temporary Tables
  • Lock Tables


This concludes our work with MySQL and phpMyAdmin. Localization of Drupal (from translators) In order for the installation process to match the illustrations in this guide, you must install the Russian version of Drupal. To do this, you need to download its translation. Translations of Drupal and its modules into Russian are available on the site Drupaler.ru. To download the translation of Drupal itself, go to this page, fill out the form as shown in the figure and click "Export".

Then unpack the downloaded archive into the same directory where Drupal was unpacked a little earlier.
Translations of additional Drupal modules are also available on Drupaler.ru. Since we will need the CCK and Views modules later in the tutorial, download their translations right now from the CCK Translation and Views Translation pages.

Installing Drupal using the installation wizard So, enter the following URL in the address bar of our browser:
localhost/drupal
If you remember to rename the unpacked Drupal directory to "drupal", everything should work. If you forgot, replace "drupal" in the URL with the folder name that you specified when unpacking the Drupal files into htdocs.
As soon as you go to the URL above, you will immediately see the Drupal installation menu. You can select the desired Drupal interface language on the first page. Please note that this option can be changed later from the admin panel. We will proceed with the installation in Russian, so let's choose "Install Drupal in Russian".
On the next screen, Drupal will check if your server (in our case, the local machine) is capable of running Drupal. If your server does not have enough applications for Drupal, an error message will be displayed.
Next, you will see the database configuration screen. Here you need to provide the information that you used when creating the drupal_db table and the drupal_user.


In the same place, on the database settings screen, click on " Advanced settings"And you will see an option called" Table prefix", Which allows you to assign a given string to the name of all Drupal MySQL tables (eg blackjack _drupal_table). I recommend that you set a random prefix that only you can understand; this caution will help reduce the threat of a SQL injection attack on the database.


If all the previous steps were performed correctly, Drupal will start installing the required modules, after which you will be redirected to the site configuration page.


The configuration options are intuitive, so I'll let you enter all the necessary information yourself.

Configuring Clean Links One option that you may not be familiar with is called "Clean Links" and is located in the "Server Settings" section. The links generated by Drupal by default are not intuitive and look something like localhost/index.php?q=21 .
When clean links are enabled, URLs look nicer, are easier to remember, and improve SEO. For example localhost/events .
Clean links require mod_rewrite (an Apache module) to be installed on the server. Most likely, you already have it installed.
If mod_rewrite is not installed or running (which is unlikely if you have an Apache server), Drupal will throw an error and use clean links will not be available. This won't stop us from building the site, but for the reasons described above, clean links should be included as quickly as possible.

If you followed the guide accurately, you will see this screen:

Don't worry if there is an error in the mail() function: it occurs because we are using XAMPP on the local machine and simply did not set up a mail server, therefore Drupal will not be able to send mail to administrators.
When you work with a real server, these things will already be pre-configured (unless you are making your own web server, which is not already configured).

Going to the Drupal Admin Let's go to the Drupal Admin. Once you visit the new site at localhost/drupal , the following page will appear:


Go to the admin panel by clicking on the "Manage" link.
Now that you've installed Drupal, it's time to discuss the concept of modules. What are Drupal modules?

Modules are extensions to Drupal that add additional functionality to it.
For example, Drupal comes with a pre-installed module called "System". In fact, Drupal is a set of core modules that are developed and maintained by the project team. The "System" module is one of them, Drupal cannot work without it.

How to add Drupal modules In addition to the core modules included with Drupal, you can download additional modules from the official . In addition, after gaining development skills on the Drupal Modules API, you can create your own modules.
Once you find the module you need, download it to your computer.
Then you need to move the unpacked module to the drupal\sites\all\modules directory.
There is no module folder by default, so you need to create it manually. Create a modules folder in drupal\sites\all.
It's good practice to keep downloaded modules separate from those that come with the default Drupal distribution, so don't put additional modules in drupal\modules .

Add-on installation: The CCKCCK (Content Construction Kit) module is a very popular Drupal module that allows you to create all sorts of new types of content. Let's practice installing modules using CCK as an example, especially since we will need it in the future.
First, download the appropriate version of CCK. Then unzip the archive to drupal\sites\all\modules; unpack the archive with the translation of the CCK module downloaded earlier from Drupaler.ru into the same folder.
After downloading and placing the CCK module in drupal\sites\all\modules, you need to enable it in the Drupal administration interface. Go to Site Build > Modules (localhost/drupal/admin/build/modules). Here you will see the CCK* module. Turn it on. You can also include CCK submodules if you need them (later, when we start working with CCK, we will do this).

* - according to the tradition that has developed in time immemorial, the module, everywhere called CCK, is called Content in the list of modules.
Congratulations! You have just installed a Drupal module.

Drupal Admin Pages: A Crash Course There are two options for viewing Drupal's administrative sections:
  • By tasks.
  • By modules.
  • If you select the By Tasks display, the page will be organized by various administrative tasks.
    For example, if you organize the By Tasks page, under the Contents heading, you'll see all the tasks related to working with content. "Content", for example, allows you to view, edit and delete materials, and "Publishing Settings" controls their behavior and display on the site.
    Each task has a brief description below its title to help you understand its purpose.
    If you choose to display "By Modules", then the links will be organized by modules.
    For example, in the "By modules" display, under the "System" module heading, you will find the items "Setting access rights", "Clean links", "Modules" and so on. Curve of learning the admin interface It can take a very long time to get used to the Drupal administrative interface; however, there are many additional modules that greatly facilitate the work with the admin panel.
    I advise you to install the Administration menu module, which adds a drop-down navigation menu at the top of all pages of the site, visible only to the administrator.

    Setting up the main page Time to act. Let's create the main page. To do this, we will add the first material of the “Page” type to the site. Go to Content > Create Content > Page (localhost/drupal/node/add/page).

    The theme that Drupal uses by default displays a navigation menu in the top right corner. The settings in the Menu Options section determine whether or not to include a link to our page in the navigation.
    If you want to add a link to the main page in the main navigation menu, select "Main Links" from the "Parent Item" dropdown menu.
    The Weight option allows you to organize the order in which links are displayed. Links with less weight will be displayed first because they are "lighter".
    So, for example, if the "Home" link has a weight of 0 and the "About" link has a weight of 5, then the "Home" item will be shown first because it is lighter.
    If the "Home" link has a weight of 0, and the "About" link also has a weight of 0, then Drupal organizes the links alphabetically. Since the weight is the same, the item "Home" will be shown first.
    In our case, we leave the weight of the "Main Page" unchanged (by default, the weight is zero).

    The selector in the "Input Format" section allows you to select how the content is to be entered.
    The Filtered HTML format limits the set of HTML tags that can be used in text by filtering out dangerous HTML elements like , which can be used to attack the site visitor's browser.
    Use the Filtered HTML format if site administrators are unfamiliar with HTML.
    Developers should use the Full HTML format. Using this format assumes that you are familiar with the HTML language.

    If only one person is creating content on your site, this option is probably not useful to you (unless you are very forgetful).
    If you're working with a team of contributors and want to keep different versions, keep a log of content changes, and make notes about the nature of those changes, the Revision Notes section is very helpful.
    In addition, with the checkbox " Create a new edition» The old version of the material will be saved in case you want to return to it.

    These options allow you to enable or disable visitor comments for this content. We probably don't need comments on the front page, so I chose " Disabled».

    In this section, you can change the author's name and publication date.
    You do not need to fill in these parameters every time - Drupal will do this itself, provided that you have not changed them.

    This section defines the material publishing settings.

    • Published- displays the status of the publication. Uncheck the box if you want to remove the material from publication.
    • Post to homepage- the material will be displayed on the main page of the site. Uncheck if you don't want to display content on the main page.
    • Pin to the top of lists- the material will be displayed at the top of the main page and other listings.

    Let's look at the main page And here is our main page; it's very simple so far, but don't worry, we'll make it more complicated soon.

    What we're going to do next Next, we'll make a job board filled with users.
    In the process of creating it, we will work with custom content types, Views, and other Drupal site development tools. What is a node in Drupal? Before continuing, it is necessary to discuss one of the most confusing topics for beginners - the concept of nodes.
    A node is a basic element in Drupal's content structure. Simply put, if you imagine Drupal as a building, then the nodes will be bricks. Every piece of site content is a node - be it a page, a forum post, an article, and so on.
    Keep in mind that the administration and user profile pages are not considered nodes because they are generated by the system and not by users.
    A node is an essential concept that you need to understand if you plan to develop complex sites on Drupal. Despite the fact that the meaning of the nodes is often incomprehensible to beginners, they give the Drupal developer incredible flexibility in creating and configuring sites.
    To see this with an example, let's go to the main page we created earlier. Pay attention to the address bar of the browser, it will say something like this (if clean links are disabled, the address will look different):

    In the address you will see the word "node"; this means that this page is a node.

    Creating a new content type in Drupal Creating a new content type is a great way to customize your site to your needs. For each type, you can define a display method, assign access rights, attach additional properties - the possibilities are simply endless. Let's create a type of material "Vacancy" Let's make a job board for our site. Users will post jobs and projects, sort of like a little Craigslist.
    For each vacancy, we need the following fields:
    • job title;
    • detailed description;
    • department - in the form of a drop-down list;
    • work experience - text field;
    • salary - text field.
    Working with custom material types in Drupal is easy. First go to Administration > Content Types > Add Content Type.

    Almost all elements of the page for adding a new type of material are provided with explanations. I consider it necessary to talk separately about the "Type" element. Type is the machine name of the new material type used in more complex designs.
    In our case, for vacancies we will set the machine name of the type of material "job". This is a very important point: in the future, when you become Drupal ninja masters and want to make complex changes to your site, such as changing the way ads are displayed, you will need to create a file called node-job.tpl.php (this is already out of scope). this manual).
    Now fill in the Name, Type, and Description fields and we'll move on.

    In this section, you have the opportunity to create and customize a form for entering job advertisements; this is what users will see when they post vacancies.

    Setting up the publishing process The publishing process settings contain the main parameters for publishing material. If you want the vacancy to be published without prior review by the administrator, check the "Published" box.

    Continue to customize the publishing process. In the “Comments Settings” section, you can set different options for commenting on vacancies. If you want visitors to be able to comment on jobs, enable comments. If you don't want it, turn it off.

    Creating the "Vacancy" content type It's time to click "Save" to complete the creation of our first content type. If you followed the instructions, "Vacancy" will appear in the list of content types (next to the page, article, and so on).

    Customizing Content Types with CCK So we have our own content type. Now we need to customize the form for adding vacancies using an extremely useful module - CCK.
    CKK is, as a rule, the first module that sophisticated developers put on a newly minted site. It is so important that it will be implemented into the core of Drupal 7, after which you will no longer have to manually download it.
    At this point, you should have installed CCK as described in the description of working with modules at the beginning of the manual. Let's enable some CCK sub-modules To get started, go to the menu Administration > Construction > Modules .
    In the CCK section you will see a list of submodules. Some of them are already enabled by default, and some are not. Why? Drupal's architecture is extremely modular, and this allows us to use in development only those tools that are really needed. Module developers are encouraged to group them by functionality, as a result of which the modules are less cumbersome and more economical.
    As a site administrator, only enable modules and submodules that you really need.
    Now let's enable some of the CCK submodules we need for the job posting form.
    Here are the submodules to include:

    Since users may be required to enter fractional numbers (for example, required work experience in years), we will need to include the Number submodule.
    We also need the Option Widgets module, which allows us to add various input elements, such as checkboxes, radio button groups, and so on.
    Each of these submodules depends on the Content module: you won't be able to enable them while Content is disabled.

    Have you enabled CCK submodules? Great, it's time to set up the job posting form.
    Go to Administration > Content > Content Types, then click the Manage Fields link in the Actions column next to the Job posting type. This is where we will add new fields to the form.

    First, I'll add a "Department" field, allowing the user to select from a drop-down list the department in which the vacancy has arisen (Development, Finance, UI, IT, and Marketing).

    After clicking the "Save" button, you will be redirected to a page where you can finally customize the "Department" field and list its valid values.


    The next field is “ Experience”, the user will be able to enter fractional numbers into it (for example, 3.5 years).

    In field " Help text» Add a hint about how to correctly fill in the field so that visitors enter the correct values.


    In chapter " General settings» you can limit the field value. For example, if you enter 2.3 in the "Minimum" field, then when trying to post a job with 1.4 experience, the user will be shown an error message.


    The last field in the "Vacancy" material type is "Salary". This is an integer, for example, 50,000 rubles.

    In the general field settings, specify 0 as the minimum to prevent negative values, (for example, -1200). Why not specify a value greater than zero? Because zero salary means that this work is not paid.
    After creating all the fields, their list for the material type "Vacancy" will look like this:

    By dragging the cross icon to the left of the field names, you can change the order in which they are displayed in the form for adding vacancies.

    Create some jobs Before we move on, create some jobs by going to the Create Content > Jobs page. We'll need their data in the next part of the tutorial. CCK is a very powerful tool We've been working with the simplest CCK fields here, but this module also provides much more advanced content organization. For example, you can install the ImageField module to allow users to post images (for example, let employers post pictures of their workplace).
    If you need additional CCK fields, check out this list.

    Tags:

    Add tags

    Drupal Features

    Drupal is a website content management system created by Belgian Dries Beitart in January 2001. Very popular in Western Europe and USA. The engine does not impose any restrictions on the programmer, it all depends on the knowledge and time that can be devoted to the development of the site.

    A number of simple functions available to everyone in the standard version of the program are suitable for creating a simple project: a blog, a news feed, a business card site. And if you need to create something extraordinary or it's simply not possible in this "version" - download and install the modules, they will expand the capabilities of the system. Modules are a feature of Drupal, they form the structure of the engine. Roughly speaking, you put on the site only what you need.

    Creation of a site on Drupal

    For starters, you need to know that you can not take a steam bath and install Drupal on a local server yourself, but take advantage of ready-made hosting offers. Here is an example:

    But let's say you chose the self-installation path anyway. Then, go to the site, click on the Download & Extend section located at the top left, download the engine by clicking on download drupal

    Select the compression format we need. GZ is for Unix systems, and ZIP for Windows, after downloading, unpack the resulting archive into the appropriate directory of the local web server.

    If you don't have a local server, don't worry - use Open Server, it's completely free.

    Now that you've set up a local server, you need to create a database using the phpmyadmin tool, which will be used to store the necessary information.

    To do this, click on the program in the lower corner and select the menu item: advanced - phpmyadmin.

    When you are prompted to enter a username and password, enter "root" in the user field and press forward.

    Now, it's time to install drupal itself on the open server. To do this, go to the root of the program, where the open server is located and create a new folder there, where we unzip our CMS Drupal

    Now it remains to restart our local server, on the open server icon at the very bottom of the desktop, click - restart.

    Now select the language, it is English by default, enter the name of the database in the first column, and your username and password in the next column. All this was created by you a couple of minutes ago in the database.

    Now fill in the fields for your site. Its name, Email, create an administrator and a password for it. Congratulations, the installation is complete, now it's time to Russify the site.

    Russification of the site on drupal

    Without further questions, click, scroll to the very bottom and download.

    Now unpack this module into your website folder, path: C - Open Server - domains - your directory name - sites - all - modules . All future modules should only go here.

    On the admin panel, select modules and scroll to the very bottom, there we put a tick in front of the new friend.

    The next step is to go to configuration and click on languages ​​, there you need to add a new one using the add languages ​​command and select Russian from the list. And most importantly, after the jump, do not forget to enable it by pressing default . We save the configuration.

    Congratulations, we went through the most difficult thing together, now (if you are not tired after this) run to the open spaces to comprehend new things and improve your site. Click on the link, there is a useful channel, where they talk about CMS Drupal quite easily and in an accessible way. And if, after all of the above, you decide that it is long and difficult for yourself, then contact.

    Sincerely, Your Essence!

    In this tutorial, you will learn how to add a new page and a menu button pointing to a page on a Drupal site.

    For this:

  • Login to your Drupal admin panel;
  • Click “Add content” at the top;
  • On the next page, select “Basic page” (or another type of content from the proposed list);

  • Specify the title of the page (required). Click "Summary" to add additional text, or leave it blank to use a snippet from the full text of the article. Add the main content to the "Body" field.

  • Scroll down to the vertical tabs and click “Provide a Menu Link” on the “Show menu Settings” tab to add a menu item pointing to the page.

  • Specify the menu link title, description (displayed on hover), and define the parent menu item;
  • In the "URL path settings" section, you can add an alias for the current page, which will be displayed in the browser when you go to this page, for example "new-page". If you do not fill in this field, then the page address will be ?q=node /#

  • Make sure the page is marked as "Published" in the "Published options" section and click "Save"
  • Go to the main page of the site and make sure that the menu and the created page are displayed correctly.
  • In this series of videos, we will try to create a Drupal 8 blog from scratch. From deployment and installation, to coding and layout.

    Who is this video for?

    In these videos, I will show how I would make a blog on Drupal 8. It is in the technology stack that I use. In other words, I will make a blog, as if I were doing it now, but along the way I will comment on my actions.

    This is not a typical guide where everything will be chewed up. I will only try to explain what I am doing, why I am doing this, why this way, and not otherwise. The calculation is that watching the video, you will slow down on those parts where it is not clear what I am doing and google. For those who are already more or less familiar with Drupal, this will allow you to look at some things from a different angle and, perhaps, discover something new.

    I mean that you are at least familiar with what Drupal is and some minimum, for example, what are content types and have already clicked something in the admin panel. If there is no such database, get ready to google :).

    How do we build a blog post?

    The work will be done through GitLab in a specially created repository.

    We will create puzzles there, solve them, close them and push them to the repository. All your suggestions for improvement, creation of something new, questions and all that, it is better, of course, that you create in issues. Since you are reading this on a blog, someone will be watching the video through YouTube, and someone else might be somewhere else. So, we will all have one centralized place for questions, tasks and suggestions. We will try to work collectively and openly, still OpenSource, no matter how. ?

    Everything that I do and show in the video is far from obligatory parts, and you must understand this and distinguish somewhere yourself where something can be missed. For example, using Git, GitLab, Docker4Drupal and generally Docker for a local server, as well as Linux is absolutely not necessary, although I would recommend all of these. But whether you use it or not, the essence of this and the result should not change. We primarily work with Drupal and its API, and not with other technologies, even though they somehow interfere with our development.

    Warning

    I already wrote above that I will make a blog, the way I would do it at the moment and the stack of technologies that I use. My approach is not ideal, and it may differ from yours, or some other. Don't take it as the right one, it's just one of many. If you don't like something about it, either ignore it or write how you would do something that you didn't like. I'm always happy to look at other solutions to a problem, as I'm not afraid to borrow good ideas and practices from others.

    Some of my actions and decisions in the process will be unchanged, as I do this, and this is how I will show you. Because I can explain to you why it is so, and not otherwise.

    Also, my approaches can change a lot over time, and, for example, six months after the release of the first video, I may already have other solutions, approaches, modules, etc. It's unavoidable, but if anything changes drastically, that's what I'll bring into the video as well.

    Part 1

    In the first part :

    • Let's deploy a local server for the site using Docker4Drupal.
    • Install Drupal 8.5.6 using Composer Drupal Project.
    • Install and configure dependencies (modules and more), as well as patches for them and the Asset Manager repository using Composer.
    • Let's add 7 types of paragraphs and 2 types of material.
    • Let's work with GitLab.
    • Let's see how to deploy a full copy of the project at home.

    We have reached the lesson, which details the procedure for adding new content to the site.

    I think it's not worth focusing too much on the fact that creating a content type is just the beginning of a long journey of creating a site on the Drupal platform. The next logical step is to populate our content type with content. This requires adding new content to our content type.

    To add a new article of our blog, you need to hover over Content in the main panel of the Drupal administrative menu, then in the pop-up menu, hover over Add content and in the next drop-down area select the line with our type of material - Blog.

    Main content form

    After the click, we go to the form page, which helps to perform the operation of creating new content. Under the heading of the page of the form for creating a new article of our blog, you can immediately see the help message "Fill out the form to add news", which was created by us when working with a new type of material.

    After which we can see the field for entering the title of our blog article.

    A little lower is the Body field, where the basic information and essence from our article is entered. In the example, we will not come up with a unique article on some topic, but we will use the so-called fish text to visualize the result of our work at the end.

    Below the Body field is a text filter that processes the content before displaying it on the article page. A detailed description of the operation of these filters will be considered in the future in another article, so we will omit this question for now.

    It is worth recalling that content can be displayed in two ways. The first method displays the content completely with all the information specified in it. Within Drupal, this term is called Full content (in Russian - Full content). The second output method allows you to display abbreviated information about the article using some of the content components, such as a picture from an article or its title. This method in Drupal is called Teaser (in Russian - Announcement).

    To start working in the announcement mode with the contents of the material type, you need to follow the link Edit announcement, which is located next to the name of the Body field (see the figure below).

    Similar to the form for creating a new type of material, on the content page at the bottom there is a vertical menu with additional parameters. Next we will work with him.

    Menu setting

    The first tab you open by default goes to Customize Menu. The first option is Create Menu Link. You can tick the checkbox or not. Based on the name, it is clear that this field allows you to create a link to an article in the menu. If you check this box, then the following configuration fields will appear next:

    • Menu Link Title - a field that defines the name of the column in our main menu bar with a link to our article. By default, the title of the article is inserted here, which we entered earlier at the initial stage.
    • Description - special help for users, which will be displayed when hovering over a link in the menu.
    • Parent is a field that offers options for saving the link according to the hierarchy of the menu tree. In other words, we select the section or subsection in which our article will be located. By default, it is proposed to save the link to the root area of ​​the main menu of the site.
    • Weight - allows you to set a certain order of the location of our articles. The more weight we set, the further from the beginning the link to the newly created blog article will be located.
    Editorial Information

    The next tab of the New Content Options vertical menu allows you to create a new version of our article. The title of this tab is Revision Information. To consider an example, working with this tab is optional, so we go further down our list.

    Address settings

    The third area is called Address Settings with a single field that specifies URL Synonym. Synonyms allow you to create a logically understandable address for a blog article page. For more understanding, take a look at the layout of the link that will be used for our article: http://[our website domain]/[Synonymous URL]. If no alias has been created, then by default the system kernel will generate an address with the following pattern: http://[our website domain]/node/[our material ID]. As a result, the page has two valid addresses, but our beautiful address will be displayed in the browser line, and not the tricky Drupal one.

    Comment settings

    After that come the Comment Settings - it has two provisions that are responsible for allowing commenting and for prohibiting it. When creating the type itself, the possibility of commenting on the content opens, however, using this field, you can individually prohibit commenting for some articles.

    Author Information

    After the comments there is the tab Information about the author - allows you to fix the author of this article, as well as the date of publication. These fields are filled in automatically. They contain the current user login and the real date and time.

    Publication settings

    The last tab in the vertical settings menu is Publish Settings, which allows you to manage the following options:

    • Published - allows you to save the article in the database of the site without displaying it on our resource. This script is executed if the checkbox is not checked. Otherwise, if the checkbox is checked, the material is published on the corresponding page of the site.
    • Placed on the main page - this checkbox is responsible for the possibility of displaying the article on the main website.
    • Pin to the top of the lists - allows you to fix in the first place in the list of created articles.

    After finally setting up all the necessary settings for our blog article, be sure to click the Save button so that our work is not in vain.

    Displaying content on the site

    When the new article is finished saving, Drupal automatically goes to this page to view the results of the work.

    What can we see on our blog page?

  • The main menu of our site with a link to a new blog article.
  • The title of the informational material.
  • A tab that allows you to make changes to the article. It is worth noting that this mark is displayed only for the site administrator or the person for whom the administrator has delegated the rights to edit articles.
  • Article author and publication date
  • The main content of the article - in other words, the body (Body).
  • Block for commenting on an article
  • Also pay attention to the address of the article in the line of your browser! Our address is indicated there, which was indicated in the URL synonyms.

    If we go to the main page of our site, we will see the display of the blog article by the second method - the announcement. The announcement contains a link where you can go to the full version of our article.

    At this stage, the procedure for adding a new page to the site is completed. We will touch on further changes to the page and its display using fields in