Using drupal. CCK is a very powerful tool


Drupal is an open system, on the basis of which websites are created, and it is also a platform from which you can manage the content of a website using additional extension modules. Its value lies in the fact that it allows its visitors to create combinations of modules with a simple wave of the hand. From them they create full-fledged web resources that are not only effective and with a wide range of capabilities, but also did not require writing program codes for their creation.

The next edition of the book “” has been published, with the help of which readers will be able to understand the essence of the system, the operating principle of the main modules and their settings. This will also give you the opportunity to understand which module you need to choose depending on the goal set for the site developer.

The book "" examines the detailed development of resources of such types as:

  • Catalog with vacancies
  • Wiki - project
  • Photo gallery
  • Online store
  • Collaborative site with shared management and multilingual capabilities

The creation of each type of project is covered with detailed instructions and a list of actions, which are described in great detail. Any beginner or professional programmer will find a lot of useful material on this paper medium and will be able to start creating their own resource based on the CMS.

WHAT IS THE POINT?

The book “Drupal: Creating and Managing a Website” will help you save some of the time it takes to get up to speed and instantly set you sailing through this extraordinary world.

Drupal is an application platform in the PHP programming language and a website management system. It is open and modular - due to this, it is very popular among web developers around the world. In order for Drupal 6 to be released, at least 900 people contributed code and ideas, and many more developers created and maintained the approximately 2,000 modules used to expand the functionality of this CMS.

The development of the Drupal project is truly almost instantaneous: as soon as new trends in the development of the Internet appear, the next day new modules for the platform are released that correspond to these trends.

This multitude of modules makes it easy for developers to create effective, feature-rich web resources without touching the code. Many people use Drupal to build individual blogs, corporate sites, photo galleries, information resources, message boards, and many other types of sites.

But this is also the disadvantage of Drupal - some administrators and very experienced developers cannot experiment and determine the function of each module and determine the boundaries of the platform's capabilities.

DRUPAL BASIS

This CMS is very young and its creation and development is carried out exclusively by enthusiasts all over the world. About 120 thousand active sites have already been created on the basis of this platform; no one even undertakes to count the total number of resources ever created on this CMS.

The basic package of Drupal includes standard services for creating full-fledged blogs, news and social resources, as well as information sites. However, in addition to the classic set of functionality that is familiar to users from any CMS, the Drupal platform has a whole line of additional services as standard:

Possibility of structuring materials The ability to organize the materials of your resource into categories by assigning a label or “tag” to any material of any type (graphic or text). When searching for material, the “tag” will work as a kind of filter.
Availability of an audit system It makes it possible to save any number of versions of each document on a resource, view and compare the number of versions of any website page that is necessary. Accordingly, you can “roll back” to any version of the previous saved version of the site, page or document.
Multilingual When translating into another language, both the interface and all other content of the resource are translated.
Automation An automatically configured system that notifies you when the next update for the platform is available.
Multisite capability This ensures that a certain amount of resources are organized per CMS installation. The uniqueness of the system lies in the possibility of a common user base with completely different and unrelated content of each individual resource.
Versatility Specialized assemblies in huge quantities (the core with modules and settings is already included) in order to create sites such as a store, communities, news or social sites.

LIST OF SITES CREATED ON DRUPAL

In order to create a business card-type website, a resource with presentations or a blog, the basic configuration of the platform is enough for any user. But if you use additional modules, you will end up with a more complex website format:

  • The ability to share two or more accounts that allow you to work with a resource - a direct path to corporate sites
  • Add the Commerce module - and you almost have an average online store where payment for orders is carried out using electronic means
  • Using rating modules – the ability to create social networks
  • Adding a search engine promotion module can integrate the main principle of internal optimization into websites, which allows you to quickly promote a virtual directory, a portal with information or a network on a specific topic.

The biggest wave of sites on the Drupal platform are the many social communities and news sites. But this is not the limit of the possibilities for using CMS. There is a fairly large list of commercial and non-commercial projects that are implemented on the basis of Drupal.

DRUPAL FEATURES

Those features that can limit the range of applications of the platform are the complexity of managing the system interface and the heavy load on the databases. Large companies can solve this problem by installing a server, but small and medium-sized companies that can only pay for very cheap hosting will constantly run into this problem.

Due to the unique architectural implementation, this platform is an ideal option for news, information or social resources.

Drupal is suitable for implementing a small project on a good budget, which requires individual development of the interface.

Drupal is the choice of those for whom the quick implementation of resource functionality comes first. In order to quickly complete any task, from the entire array of modules (about 20 thousand) you will always find one whose functionality can be used on your resource almost instantly.

But still, each CMS has its own advantages, thanks to which the choice of a website creator when working on a particular project falls on it.

Why Drupal?

What are the advantages of the Drupal system:

  • Drupal is one of the three most popular CMS systems. More than 2% of all sites on the Internet operate on it. With its help, you can quickly create a website yourself. Due to the fact that the system is distributed under the GNU GPL license, any commercial or non-commercial project can be created on its basis.
  • Drupal powers sites such as Forbes.ru and the French Government website.
  • The versatility of Drupal is ensured by its base, which, in essence, is a framework for website content management systems and .
  • If we compare Drupal with other CMS systems, we can say that other systems have ready-made models, while Drupal is a system that allows you to create any of them, that is, it is a “constructor of constructors.”
  • Volunteer specialists work with Drupal, constantly finding “gaps” and updating the core of the system, regularly producing additional modules and assemblies.
  • Despite all the variety of functions, Drupal is a simple system that can be operated by a person without special knowledge. Although, of course, it is more difficult to deal with than with Joomla. Before creating a website using this CMS, it will first need to be assembled from small disparate parts into a system.
  • Installing Drupal

    There are several ways to install Drupal:

    • choose hosting with an engine already installed on it;
    • download the distribution from the Drupal website, then install it on the server;
    • installation and configuration of the system on a local server and subsequent transfer to your server.

    To install Drupal on hosting you need:

    If everything is correct, the system will open the main page of the site, from which you can start working.

    Setting up CMS Drupal

    Setting up Drupal involves sequentially performing the following steps:

    1. Before starting work, it is necessary to Russify the engine. This is achieved by installing Multilingual modules in the module management section. In the Configuration - Regional and language section, you must select Russian from the drop-down list. Then you need to download the translation file from the official CMS website, in the Configuration - User Interface Translation section, select the Import tab. The translation file must be uploaded to the server. Next, set Russian as the default language.

    2. Installing themes for the site and administrative panel

    In the “Appearance” section you can find Drupal themes, to download which you need to click on “Install as default”.

    Other templates can be found on the official website of the resource, where themes are presented by default by their level of popularity. Filters will allow you to sort topics by additional indicators.

    Choosing a theme with a responsive design will help attract smartphone users.

    At the beginning of the work, the user is taken to a page with a standard design theme for ease of reading the manual.

    3. Logo customization

    The logo can be configured in the “Appearance Settings” section by unchecking the “Use the theme’s default logo” box. Next, you need to upload an image or specify the path to the file where the logo is located on the server.

    4. Configuring content display blocks

    Everything on Drupal CMS sites is organized into content blocks. The latter is placed in regions on the selected topic. You can see the number of regions in a specific topic in the “Structure” section, subsection “Block diagram”.

    To set the default settings for content blocks, just select a display region in the “Block Scheme” and add a block to it.

    For each block, you can configure displays: in what language the block will be shown, the type for the block, who will see this information.

    5. Setting user rights

    The Drupal system requires the appointment of one of three types of users: anonymous, registered user and administrator.

    The Rights tab describes the benefits of each option. On the "Roles" tab, you can edit existing user "roles". Here you can add new system users with their roles and functions.

    By assigning roles, you can encourage users to authenticate in the system, “luring” them with the ability to add additional features. privileges.

    6. Setting up the site menu

    To configure the site menu, you need to perform a number of sequential actions:

    • Select the “Structure” section in the control panel;
    • Go to “Menu”;
    • Click "Edit". Here you can add new or edit existing menu links. To do this, you need to select the sub-item of creating a new link, set the “Weight” of the link to determine its order among other links.
    • Next, you need to set the name, description and language of the menu.
    In addition to basic settings, you need to take care of the functionality of the system. SEO optimization of a Drupal website

    The Drupal system by default meets the requirements of search engines. Optimizing technical aspects will help improve the visibility of the site:

    1. Setting up aliases. The content of a Drupad-based site is organized through nodes—units of content that have a separate URL.

    For machines, this way of representing URLs is convenient. For people - not very much. For the convenience of users working with a resource, it is necessary to configure aliases - synonyms of URLs leading to the same resource. You can set them either when creating a publication, or edit this information later; to do this, select the desired entry in “Content” and click “Edit”.

    Advantages of Drupal over Joomla! and WordPress

    All three listed systems have an equal chance of being chosen for creating both simple and complex projects, regardless of their specifics.

    But, compared to WordPress, Drupal is a more flexible system - most of the features that WordPress can provide only after installing additional plugins, Drupal has in a pre-installed version.

    These are functions such as setting roles, compressing page content.

    Drupal, compared to Joomla, requires much less configuration, thanks to the built-in function editor.

    The CMS Drupal control panel is intuitive and can be mastered by a non-technical user. Therefore, there is no need to be afraid of its functional “complexity”. You can work with the site on an intuitive level, you just have to start.

    Now you can successfully work with this CSM! Good luck!

    Sincerely, Nastya Chekhova

    (Drupal) is a popular open source content management system. Because of its powerful functionality, developing complex websites in Drupal is much easier than writing them from scratch. It's no wonder that thanks to its large user community and huge number of modules, we hear about Drupal more and more often.
    In this tutorial, we'll get hands-on with Drupal and create a site with a new content type and pages to display it.
    Ready? Let's 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 operation;
    • learn about Drupal modules;
    • learn to work with administration pages;
    • create and publish website content;
    • configure your content type with CCK;
    • learn how to create views to display content using a module Views;
    • create paging views;
    • create views with block display;
    • learn about design themes.
    What we'll do We'll develop a Drupal website with a job board where visitors can add jobs and projects. Our goal is for you to start creating websites right away, and not just read how it's done. Why Drupal? First, let's take a quick look at what the advantages (and disadvantages) of Drupal are so that you can decide whether this CMS is right for you. Advantages Open source. Yes, Drupal is open source, which means you have access to all the benefits of open source software.

    Configuration flexibility. 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 design portfolio posts. Drupal will do a great job (of course, you will have to work a little for this).

    Large and knowledgeable developer community. Drupal has a large, vibrant, and open community of users and developers. This means you have access to excellent modules, timely bug fixes and kernel updates, as well as an inexhaustible stream of documentation and tutorials on the Internet.

    Modules A huge number of modules have been developed for Drupal, expanding its original functionality (we’ll talk about what a module is a little later).

    Ease for developers. As a web developer, you will not feel limited when working with Drupal. After all, Drupal was developed taking into account the needs of developers. The mistake of some major CMSs is to overemphasize the user interface, which often leads to a lack of attention to the needs of those who will actually 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 CMSs, Drupal has a very good search system 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 a little more difficult than learning other CMSs. I would not recommend Drupal if you want to make your first website after just a week of getting acquainted. It will take you more than one month to truly understand Drupal, and the same amount to create your first full-fledged website. However, it should be noted that you can create a small website in less than a day (that’s what we’ll do in this guide).
    Difficult for non-developers. Since the needs of developers are at the forefront here, those who are not very familiar with information technology will take some time to get used to Drupal. This means that specialists with only a superficial understanding of web development 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 Whenever Drupal is discussed, there's always an overwhelming urge to compare it to another leading open web platform; usually this is WordPress.
    And wherever you suggest that WordPress is not a full-featured CMS, but just a blogging platform, you will always find a heated debate awaiting you. I myself use both CMS, but sometimes the capabilities of WordPress are simply not 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 website with video and audio materials that are added by the users themselves, it makes sense to use a more serious CMS than WordPress.
    I would not recommend you use Drupal if the client only needs a blog or a simple portfolio site with a few pages and basic content: such sites are faster and easier to make in 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 inspire you, I will list a few sites powered by Drupal.

    Mozilla, the company responsible for Firefox, uses Drupal in almost all of its web projects. The official websites of Mozilla and Spread Firefox are made on Drupal. Download and install Drupal For the purposes of 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 will be similar.
    To install Drupal on your 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 written by Jacob Gueb (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, steps 1-26, keeping in mind that you are not installing WordPress, but Drupal):

    For the rest of this guide, we'll assume you're using XAMPP, so if you choose a different server package, you may need to change the installation process slightly.
    Copy the Drupal files to the 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 xampp\htdocs\drupal\sites\default folder.

    Create settings.php Make a copy of the default.settings.php file and rename it settings.php.
    Make sure you haven't deleted default.settings.php , otherwise the Drupal installation will fail; This is one of the most common mistakes made by new Drupal developers.

    Creating a MySQL database Drupal uses for data storage MySQL. So we need to configure 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 your browser by the address:
    localhost/phpmyadmin

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

    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 work sites, however, it's a good idea to use a non-obvious, random username to reduce the likelihood of being hacked by a brute-force attack.
    And definitely do not use a root account, since most hackers will “try” it first. The root user in MySQL has super privileges and has access not only to your drupal_db database, but also to other databases. (By the way, a good option is to delete the root user altogether and not use it anywhere. You can create a pseudo-root user, but more on that another time).
    To create a new MySQL user, go to the phpMyAdmin main page and then click on the Privileges tab.
    Now click “Add 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 computer and running on XAMPP), you can select all available privileges, but on a production server it is highly recommended to set only those that are actually needed by the drupal_user user.
    For our example, I selected only those 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 coincide with 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 website 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 you unpacked Drupal 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, let's 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 you specified when unpacking the Drupal files into htdocs.
    Once 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 continue with the installation in Russian, so let's select "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 required 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 to create the drupal_db table and the drupal_user user.


    There, on the database settings screen, click on “Advanced settings" and you will see an option called “Table prefix", which allows you to add a specified string to the name of all Drupal MySQL tables (for example, blackjack _drupal_table). I recommend that you set a random prefix that only you understand; this caution will help reduce the threat of an SQL injection attack on your database.


    If all previous steps were completed correctly, Drupal will begin installing the necessary 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.

    Setting up clean links One option that may be unfamiliar to you is called “ Clean links"And is located in the “Server Settings” section. The default links Drupal generates are unintuitive and look something like localhost/index.php?q=21 .
    When clean links are enabled, URLs look nicer, are easier to remember, and help improve SEO. For example, localhost/events.
    For clean links to work, mod_rewrite (an Apache module) is required 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 are running an Apache server), Drupal will throw an error and use of pure links will not be available. This will not prevent us from building the site, but for the reasons described above, we should include clean links as quickly as possible.

    If you followed the manual correctly, you will see a screen like this:

    Don't worry if the mail() function error appears: it occurs because we are using XAMPP on the local machine and simply did not configure the mail server, therefore Drupal will not be able to send emails to administrators.
    When you work with a real server, these things will already be preconfigured (unless you're making your own web server, which isn't already configured).

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


    Log in to the admin panel by clicking on the “Manage” link.
    Now that you have Drupal installed, 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 repository. In addition, after gaining development skills on the Drupal module 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.
    By default there is no folder for modules, so you need to create it manually. Create a modules folder in drupal\sites\all.
    It's a good practice to keep downloaded modules separate from those included in the default Drupal distribution, so don't put additional modules in drupal\modules .

    Installing an additional module: The CCKCCK (Content Construction Kit) module is a very popular Drupal module that allows you to create various new types of content. Let's practice installing modules using CCK as an example, especially since we will need it later.
    First, download the appropriate version of CCK. Then unpack the archive into drupal\sites\all\modules; Unpack the archive with the translation of the CCK module previously downloaded 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 the menu Site Construction > 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 (we'll do that later when we start working with CCK).

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

    Drupal Administration Pages: A Crash Course There are two options for viewing Drupal's administrative sections:
  • By task.
  • By modules.
  • If you select the "By Task" view, the page will be organized by various administration tasks.
    For example, if you organize your page by Task, under the Contents heading, you'll see all the tasks associated with working with content. “Content”, for example, allows you to view, edit and delete materials, and “Publish Settings” control their behavior and display on the site.
    Each task has a short description under its name to help you understand its purpose.
    If you select the “By modules” display, then the links will be organized by modules.
    For example, in the “By Modules” display under the “System” module header you will find the items “Setting access rights”, “Clean links”, “Modules” and so on. Learning curve of 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 working with the admin panel.
    I advise you to install the Administration menu module, which adds a drop-down navigation menu to the top of all site pages, visible only to the administrator.

    Setting up the main page Time to act. Let's create a home page. To do this, we will add the first material of the “Page” type to the site. Let's go to the menu Contents > Create Material > 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 to include a link to our page in the navigation or not.
    If you want to add a link to the home page in the main navigation menu, select "Main Links" from the "Parent" drop-down menu.
    The “Weight” option allows you to organize the order in which links are displayed. Links with lower weight will be displayed first because they are “lighter”.
    So, for example, if the “Home Page” link has a weight of 0, and the “About” link has a weight of 5, then the “Home Page” item will be shown first because it is lighter.
    If the Home page link has a weight of 0, and the About link also has a weight of 0, then Drupal organizes the links in alphabetical order. Since the weight is the same, the “Home Page” item will be shown first.
    In our case, we leave the weight of the “Home Page” unchanged (by default the weight is zero).

    The selector in the “Input Format” section allows you to select the method for entering content.
    The Filtered HTML format limits the set of HTML tags that can be used in text, filtering out dangerous HTML elements like , which can be used to attack a site visitor's browser.
    Use Filtered HTML format if site administrators are not familiar with HTML.
    And for developers, you should use the Full HTML format. Using this format assumes that you are familiar with the HTML language.

    If you only have one person creating content on your site, this option probably won't be useful to you (unless you're very forgetful).
    If you work with a team of users who add content and want to save different versions, keep a log of content changes and make notes about the nature of these changes, the “Edition Information” section will be very useful to you.
    In addition, when the " 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 a given story. We probably don't want comments on the main page, so I chose " Disabled».

    In this section you can change the author 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 specifies settings for publishing material.

    • Published- displays the publication status. Uncheck the box if you want to remove the material from publication.
    • Place on home page- the material will be displayed on the main page of the site. Uncheck this box if you do not want to display the material on the main page.
    • Pin to top of lists- the material will be displayed at the top of the main page and other lists.

    Let's look at the main page And here is our main page; It's very simple for now, but don't worry, we'll make it more difficult soon.

    What we'll do next Next, we'll create a job board populated by users.
    In the process of creating it, we will work with custom content types, Views and other tools for developing sites on Drupal. 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 website content is a node - be it a page, a forum post, an article, etc.
    Remember that administration and user profile pages are not considered nodes, since they are generated by the system, not by users.
    Node is an essential concept that you need to understand if you plan to develop complex websites in Drupal. Despite the fact that the meaning of nodes is often unclear to beginners, they give the Drupal developer incredible flexibility in creating and customizing websites.
    To see this with an example, let's go to the home page we created earlier. Pay attention to your browser's address bar, it will say something like this (if clear links are disabled, the address will look different):

    You will see the word “node” in the address; 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 for your needs. For each type, you can define the display method, assign access rights, attach additional properties - the possibilities are simply endless. Let's create a material type "Vacancy" Let's create a job board for our site. Users will post vacancies and projects, a kind of small Craigslist (translator's note: www.craigslist.org - a service for posting vacancies and resumes).
    For each vacancy we will 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 for a new material type used in more complex designs.
    In our case, for vacancies we will set the machine name of the material type “job”. This is a very important point: in the future, when you become a Drupal ninja 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 beyond scope this manual).
    Now fill out the Title, Type and Description fields and we'll move on.

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

    Setting up the publishing process Settings for the publishing process contain the basic parameters for publishing material. If you want the vacancy to be published without prior review by the administrator, check the “Published” checkbox.

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

    Creating the “Vacancy” material type It’s time to click “Save” and thereby complete the creation of our first material type. If you followed the instructions, “Job” will appear in the list of content types (next to Page, Article, etc.).

    Configuring Content Types with CCK So we have our own content type. Now we need to configure the form for adding vacancies using an extremely useful module - CCK.
    CKK is, as a rule, the first module that experienced developers install on a newly created website. It is so important that it will be implemented into the core of Drupal 7, after which you will no longer have to download it manually.
    By this point, you should have already installed CCK according to the description of working with modules at the beginning of the manual. Let's enable several CCK submodules. First, go to the menu Administration> Design> 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 only those tools that are really needed in development. Developers of modules are recommended to group them by functionality, as a result of which the modules are less cumbersome and more economical.
    As a site administrator, enable only those modules and submodules that you really need.
    Now let's include a few CCK submodules that we need for the job vacancy form.
    Here are the submodules you need to include:

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

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

    First, I'll add a "Department" field that allows the user to select from a drop-down list the department in which the vacancy occurred (development, finance, interfaces, IT and marketing).

    After clicking the “Save” button, you will be redirected to a page where you can finalize the “Department” field and list its valid values.


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

    In field " Help text» add a hint on how to fill out the field correctly so that visitors enter the correct values.


    In chapter " General settings» you can limit the value of the field. For example, if you set the Minimum field to 2.3, then when you try 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 “Vacancy” material type will look like this:

    By dragging the cross icon to the left of the field names, you can change the order in which they appear on the Add Jobs form.

    Create Some Jobs Before we move on, create some jobs by going to the Create Content > Job page. We'll need their data in the next part of the tutorial. CCK is a very powerful tool Here we worked with the simplest CCK fields, but this module also provides much more serious means of organizing content. For example, you could install the ImageField module to allow users to post images (let employers post photos of their workplace, for example).
    If you need additional CCK fields, check out this list.

    Tags:

    Add tags

    CMS Drupal has existed for more than 17 years - the development of the platform began in 2000, the author is a programmer from Belgium Dries Beutart. He is the founder and leader of this project. The engine was released in 2001 on the website drop.org. The name Drupal comes from the Dutch word drupel (translated as “drop”).

    The latest version is 8.4.4, which was released on January 3, 2018. Many people take part in releases, some of them are involved in the development process itself, others create additional modules and patches.

    Drupal is a CMS written in PHP; uses a relational database (MySQL, PostgreSQL, etc.).

    Benefits of Drupal

    1. Open source

    Drupal is distributed as free software (under the GPL license). This allows you to refine and customize the platform, and also makes it possible not to depend directly on the authors of the engine. There is also an opinion that open source projects are even better protected than closed ones.

    2. Free

    It follows from the previous point. Using open source software saves money, while using proprietary solutions usually comes at a cost.

    3. Flexibility

    Drupal has a convenient architecture that allows you to customize your site very flexibly. Thanks to this, Drupal can be used as a platform for sites of any type, from news resources to sites with forums and other social components, as well as online stores.

    Drupal can be used not only as a CMS, but also as a framework.

    4. Large community

    Drupal, like many other platforms, has a large community of developers who create new patches, modules, updates, as well as documentation, guides and much more.

    5. Modules

    Drupal has a huge number of modules that significantly expand its functionality and allow you to add almost any function. Drupal is a platform aimed at developers, not at regular users (as is often the case with other CMSs). Therefore, it will be easier for developers to understand the engine and configure the necessary functionality.

    6. Caching

    Drupal has a built-in caching system that reduces server load and reduces page load time.

    7. Hooks

    Hooks allow you to modify data during processing and perform other actions. Hooks are not tied to individual objects, but to procedural points. In Drupal, a similar model allows you to modify the functioning of the platform without introducing or rewriting a huge amount of code.

    8. Standardization

    Developers write code in the same style, and this allows you to quickly understand already written modules.

    Disadvantages of Drupal

    1. Difficulty in learning

    Drupal is a platform for power users and developers. To configure modules, you need to know programming (although if you don’t know it, you can contact a developer). Either way, you should spend some time learning Drupal before you start setting up your site.

    2. Complex interface

    It’s not that it’s completely complicated, but, let’s say, it’s not as simple and user-friendly as it could be.

    3. Minimum basic set

    After installation, Drupal contains the minimum number of tools necessary for the correct operation of the site. Therefore, this is not a ready-made solution “installed and launched”, but rather a framework of a ready-made solution that needs to be further developed using modules.

    Drupal modules

    Modules are used to expand the functionality of the engine. Immediately after installation, Drupal has several modules, but, as a rule, their capabilities are not enough to implement all your desires, so you can either write a module yourself or install a ready-made one.

    Drupal owes its popularity to the huge number of modules existing for this platform: the list on the official website currently includes 39,566 modules. In order not to get lost in so many modules, there are filters by development status, category, kernel version and other parameters:

    It is best to download modules from the official website; they also need to be updated regularly. And don’t forget to disable unused modules so that they don’t unnecessarily load the site.

    How to install the module

    To install a module, look for it in the list on the official website (for example, Entity Reference Revisions) and go to its page: https://www.drupal.org/project/entity_reference_revisions

    At the very bottom of the page there will be Downloads, where modules for different versions of Drupal are presented. Green ones are the recommended options; yellow - other releases; red - versions under development. Choose a convenient format - tar or zip and download.

    Then go to the admin panel: Extensions -> Install a new module. Uploading the file:

    And click “Install”. We see a notification that the installation was successful:

    Several interesting Drupal modules

    • Views Slideshow - a convenient module for creating slideshows;
    • IMCE - module for convenient work with images;
    • Video Embed Field - a module for inserting videos (YouTube, Vimeo) into a website;
    • Pathauto - allows you to create CNC;
    • Webform - a module for creating various feedback forms and surveys;
    • Drupal Commerce - module for creating an online store;
    • Chaos tool suite (ctools) - a module for developers that makes it easier and faster to manage pages;

    is a free, open-source CMS, developed by a large community of users with a high level of technical expertise. Available for download in the form of the system core and thematic assemblies, which include all the necessary modules for solving a specific task - for example, building an online store or information portal with elements of a social network.

    The main feature of Drupal is flexibility. In fact, this is a constructor from which a webmaster creates a system with the functionality he needs. This is especially true when working with the system kernel. Only the most basic features are available out of the box. Using modules, the webmaster creates a configuration that will allow him to implement his project.

    Drupal is loved by professional developers, but it will also be useful for novice webmasters if they spend time studying the documentation or install a ready-made assembly and study the CMS as they create the site.

    Design and working with templates

    After installing the CMS, several default themes are available in the administrative panel. To change the design, select a different template and click Set as Default. You can choose between standard themes or see all the free options in the directory on the Drupal website.

    By default, templates are presented filtered by popularity. You can sort them by other indicators or search for topics using keywords. The main thing is not to choose themes without adaptive design: given the development of the mobile Internet and the growing number of only-mobile users, it is unwise to use them when creating a website.

    To install a new theme, you need to download the distribution kit from the catalog. Open the Appearance section in the admin panel and click Install new theme. Upload the downloaded archive, then select the added theme and save the configuration.

    Themes on Drupal look different: there are frankly outdated options, but there are also plenty of good templates. However, if you want some unusual design, you will have to pay for a template developed by a designer.

    You can change the appearance and structure of the theme in its settings after installation. To do this, two tools are available in the administrative panel:

    • Block Layout is a constructor in which the webmaster moves template blocks with the mouse.
    • Theme Settings - template color scheme, in which you can edit the color of each element. In addition, here you can configure the settings for displaying pictures, logo and favicon.

    The administrative panel also has its own theme, which can be changed - the corresponding section is located at the bottom of the list of installed templates. This is another example of Drupal’s flexibility: the engine can be changed as much as you like.

    Functionality

    The development of open source systems is directly related to the number of users. Drupal has no problems with this: the CMS is translated into 180 languages ​​and has not only a large, but also a very professional community. The high level of technical training of users is a consequence of the flexibility and versatility of the system.

    To understand Drupal, you will have to study literature and thematic forums. But in the process of maintaining the site, the understanding comes that it is necessary to return to the basics and read again how this or that function works. A characteristic feature of this CMS is the ability to solve one problem in different ways.

    After installing only the system core, the user finds himself in an interface that is extremely unfriendly for a novice webmaster, in which even adding a new article requires three clicks, each of which opens a new page. There is no media manager, no categories, although in other free CMSs all this is the basic functionality of a text editor.

    To create publications and pages, the visual editor CKEditor is used. To add more tools, you need to add the IMCE module. You can edit your publication in visual mode or in the HTML editor. The “Taxonomy” module is responsible for displaying content. Categorization of materials is carried out using dictionaries and terms. By default, content is organized through a Tags dictionary, which creates post categories. When adding new material to a certain category, you need to assign an appropriate tag for it. To track resource performance, free Google Analytics and Yandex.Metrica modules are available.





    

    2024 gtavrl.ru.