Content types are the backbone of content management in Drupal. In Drupal 10, you can create custom content types to structure and organize your content. This blog post will guide you through the process of creating content types programmatically in Drupal 10, allowing you to tailor your website's content structure to your specific needs.
Prerequisites
Before creating custom content types programmatically in Drupal 10, you should have the following:
- A working Drupal 10 or 9 website.
- Basic knowledge of Drupal site building and module development.
- Familiarity with PHP and Drupal's module structure.
Step 1: Define the Custom Module
To create a custom content type programmatically, you need to place the code in a custom module. If you don't already have a custom module, you can create one by following these steps:
- In your Drupal installation, navigate to the sites/all/modules directory (or your preferred module location).
- Create a new directory for your custom module. Give it a unique and descriptive name, such as my_custom_content_type.
- Inside your module directory, create a my_custom_content_type.info.yml file with the following content:
name: 'My Custom Content Type Module'
type: module
description: 'Defines custom content types programmatically.'
core_version_requirement: ^9 || ^10
package: Custom
dependencies:
- nodeThis YAML file defines the basic information about your custom module.
Step 2: Create a Custom Content Type
To create a custom content type, you'll need to implement the hook_entity_type_build and hook_node_type_insert hooks within your custom module.
- Create a file named my_custom_content_type.module in your module directory.
- In this file, implement the hook_entity_type_build hook to define your custom content type. Here's an example:
/**
* Implements hook_entity_type_build().
*/
function my_custom_content_type_entity_type_build(array &$entity_types) {
$entity_types['node']->setClass('Drupal\my_custom_content_type\NodeTypeCustom');
}This code defines a custom class, NodeTypeCustom, to handle the configuration of your custom content type.
- Create the NodeTypeCustom class in a file named NodeTypeCustom.php and place it in your module's directory:
namespace Drupal\my_custom_content_type;
use Drupal\node\NodeTypeBase;
/**
* Provides a custom content type.
*/
class NodeTypeCustom extends NodeTypeBase {
/**
* {@inheritdoc}
*/
public function postSave(NodeTypeInterface $node_type) {
parent::postSave($node_type);
// Define the custom content type settings.
$config = \Drupal::configFactory()->getEditable('node.type.' . $node_type->id());
$config->set('name', 'Custom Content Type');
$config->set('description', 'A custom content type created programmatically.');
$config->set('new_revision', TRUE);
$config->save();
}
}n the NodeTypeCustom class, we extend the NodeTypeBase class to define the custom content type settings, such as the name and description.
Step 3: Enable and Verify Your Custom Content Type
- In your Drupal admin interface, navigate to Extend (admin/modules) and enable your custom module, "My Custom Content Type Module."
- After enabling the module, go to Structure > Content types (admin/structure/types) to see your custom content type listed as "Custom Content Type."
Conclusion
Creating custom content types programmatically in Drupal 10 allows you to define content structures that fit your specific project requirements. By following the steps outlined in this blog post, you can easily create and configure custom content types within your Drupal website, providing a flexible and tailored content management experience.
In Drupal 9 and 10, custom modules should be stored in the "modules/custom" directory rather than "sites/all/modules." Drupal's module directory structure has evolved, and the recommended practice is to place custom modules in the "modules/custom" directory to follow the modern Drupal standards.
So, if you're creating a custom module in Drupal 9 or 10, you should place it in the following directory:
/sites/all/modules/custom/By following this structure, your custom modules will be more organized and adhere to Drupal's best practices, making it easier to manage and maintain your site's codebase.
Comment
The value of buy twitter…
The value of buy twitter followers depends less on the largest number offered and more on how the service fits the account context. Look beyond the package price and check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms; the cheapest option may create the most confusing analytics. The test is easier to interpret when regular posts, useful replies, clear positioning, and participation in relevant conversations remains consistent and impressions, replies, reposts, link clicks, and follower retention is recorded before and after delivery.
A sensible review of buy…
A sensible review of buy instagram views begins with a small sample and a record of the account's normal performance. The evaluation becomes more objective when you compare gradual delivery, retention guarantees, refill conditions, support quality, and account-data requirements and score each provider against the same requirements. Watch for a large instant jump followed by visible drops a few days later, and use retention, shares, saves, profile visits, and follows to decide whether the test added anything beyond a larger visible number.
For creators considering buy…
For creators considering buy youtube views, clear limits and a consistent measurement window make the test easier to interpret. Before ordering, review traffic sources, delivery timing, audience geography, refund rules, and reporting access, and ask how the company handles delays, partial delivery, or unexpected drops. The account owner should still prioritize useful titles, accurate thumbnails, strong openings, and a consistent publishing plan and review average view duration, retention, clicks, comments, and subscriptions; this keeps the result in proportion.
The safest discussion around…
The safest discussion around buy instagram views focuses on measurable delivery terms rather than broad promises. Good due diligence means you compare gradual delivery, retention guarantees, refill conditions, support quality, and account-data requirements without sharing credentials that are not required for delivery. Avoid scaling after one attractive screenshot. Review retention, shares, saves, profile visits, and follows and check for a large instant jump followed by visible drops a few days later across several days.
https://bactribatchindia.xyz…
https://bactribatchindia.xyz/# antibiotics drugs
buy antibiotics online:…
buy antibiotics online: cheap indian generic antibiotics - antibiotics online purchase
antibiotics online pharmacy…
antibiotics online pharmacy or otc uti medicine buy amoxicillin antibiotic
https://www.google.co.ls/url?q=https://bactribatchindia.com antibiotics online purchase and http://www.orangepi.org/orangepibbsen/home.php?mod=space&uid=7259551 buy antibiotics online
buy antibiotics from india online antibiotics or buy antibiotics over the counter buy antibiotics from india
Play Aviator aviatorguide…
Play Aviator aviatorguide github io and five other popular games on one platform. Explore real odds, try free demos, and explore the game's features. Convenient birr payments via Telebirr make account top-ups and fund management easier.
Play Aviator aviatorguide…
Play Aviator aviatorguide.github.io and five other popular games on one platform. Explore real odds, try free demos, and explore the game's features. Convenient birr payments via Telebirr make account top-ups and fund management easier.
buy antibiotics: generic…
buy antibiotics: generic antibiotics online pharmacy - buy antibiotics from canada
The decision to use where to…
The decision to use where to buy instagram views deserves the same basic checks as any other paid distribution experiment. Start by asking how they compare gradual delivery, retention guarantees, refill conditions, support quality, and account-data requirements; specific procedures are more informative than claims about being the best. Keep expectations narrow: the service may change social proof, but clear opening frames, concise edits, relevant captions, and a reliable posting cadence still determines whether people stay engaged.
Before choosing a provider…
Before choosing a provider for best site to buy twitter followers, it helps to document the current baseline for the social profile. Keep the test controlled: check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms, record the starting numbers, and avoid changing several variables at once. A measured decision considers both delivery stability and impressions, replies, reposts, link clicks, and follower retention, while leaving room to improve regular posts, useful replies, clear positioning, and participation in relevant conversations.
Treat buy youtube views and…
Treat buy youtube views and likes as a limited marketing input and define in advance which account signals will be reviewed. The evaluation becomes more objective when you review traffic sources, delivery timing, audience geography, refund rules, and reporting access and score each provider against the same requirements. A measured decision considers both delivery stability and average view duration, retention, clicks, comments, and subscriptions, while leaving room to improve useful titles, accurate thumbnails, strong openings, and a consistent publishing plan.
Comparing buy tiktok likes…
Comparing buy tiktok likes options is more reliable when the buyer writes down the purpose, budget, and acceptable delivery pace. Look beyond the package price and compare delivery pace, retention terms, refill policy, and support response time; the cheapest option may create the most confusing analytics. Measure watch time, completion rate, shares, saves, and profile visits against the original baseline, because an abrupt spike that does not match the account's normal reach can make a weak service appear successful at first.
Comparing buy twitter…
Comparing buy twitter followers options is more reliable when the buyer writes down the purpose, budget, and acceptable delivery pace. Before committing, check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms, then confirm that no password or unnecessary account access is requested. The strongest conclusion comes from combining retention checks with impressions, replies, reposts, link clicks, and follower retention while maintaining regular posts, useful replies, clear positioning, and participation in relevant conversations.
The safest discussion around…
The safest discussion around buy youtube views focuses on measurable delivery terms rather than broad promises. Ask the provider to review traffic sources, delivery timing, audience geography, refund rules, and reporting access, and keep screenshots of the stated terms before placing an order. Use the result to refine future tests, but keep useful titles, accurate thumbnails, strong openings, and a consistent publishing plan as the main source of durable audience interest.
Treat buy tiktok likes and…
Treat buy tiktok likes and views as a limited marketing input and define in advance which account signals will be reviewed. It is worth asking support to compare delivery pace, retention terms, refill policy, and support response time in plain language before testing even the smallest package. Keep publishing with strong hooks, clear captions, consistent posting, and audience-specific creative; a purchased count alone cannot show whether real viewers found the content useful.
trustworthy online pharmacy:…
trustworthy online pharmacy: online pharmacy discount code - top-rated online pharmacies
Anyone researching where to…
Anyone researching where to buy instagram views should first decide what a useful result would look like for the Reels account. Ask the provider to compare gradual delivery, retention guarantees, refill conditions, support quality, and account-data requirements, and keep screenshots of the stated terms before placing an order. Avoid scaling after one attractive screenshot. Review retention, shares, saves, profile visits, and follows and check for a large instant jump followed by visible drops a few days later across several days.
When people look for buy…
When people look for buy tiktok likes, the most useful first step is separating a visibility test from a growth strategy. Look beyond the package price and compare delivery pace, retention terms, refill policy, and support response time; the cheapest option may create the most confusing analytics. Watch for an abrupt spike that does not match the account's normal reach, and use watch time, completion rate, shares, saves, and profile visits to decide whether the test added anything beyond a larger visible number.
The value of buy youtube…
The value of buy youtube views depends less on the largest number offered and more on how the service fits the account context. The review should review traffic sources, delivery timing, audience geography, refund rules, and reporting access, with special attention to exclusions that could make a guarantee difficult to use. Measure average view duration, retention, clicks, comments, and subscriptions against the original baseline, because traffic that raises the counter without improving meaningful viewer behavior can make a weak service appear successful at first.
When people look for buy…
When people look for buy instagram views, the most useful first step is separating a visibility test from a growth strategy. The review should compare gradual delivery, retention guarantees, refill conditions, support quality, and account-data requirements, with special attention to exclusions that could make a guarantee difficult to use. The strongest conclusion comes from combining retention checks with retention, shares, saves, profile visits, and follows while maintaining clear opening frames, concise edits, relevant captions, and a reliable posting cadence.
The decision to use buy…
The decision to use buy tiktok likes deserves the same basic checks as any other paid distribution experiment. Before ordering, compare delivery pace, retention terms, refill policy, and support response time, and ask how the company handles delays, partial delivery, or unexpected drops. If support cannot explain an abrupt spike that does not match the account's normal reach, the service may not be suitable even when its advertised price looks competitive.
A shortlist for buy likes on…
A shortlist for buy likes on youtube becomes more useful when price is compared alongside retention, pacing, and support. A credible offer makes it possible to review traffic sources, delivery timing, audience geography, refund rules, and reporting access before the buyer submits the profile or content link. The next step should depend on observed retention and average view duration, retention, clicks, comments, and subscriptions, not on the provider's recommendation to buy more.
The phrase buy twitter…
The phrase buy twitter followers covers very different services, so the comparison should begin with scope and expectations. A written comparison should check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms, since unclear service boundaries often cause disputes after purchase. Watch for a sudden follower increase with no matching activity on the timeline, and use impressions, replies, reposts, link clicks, and follower retention to decide whether the test added anything beyond a larger visible number.
The phrase buy instagram…
The phrase buy instagram reel views covers very different services, so the comparison should begin with scope and expectations. Before committing, compare gradual delivery, retention guarantees, refill conditions, support quality, and account-data requirements, then confirm that no password or unnecessary account access is requested. The next step should depend on observed retention and retention, shares, saves, profile visits, and follows, not on the provider's recommendation to buy more.
A provider offering buy…
A provider offering buy instagram views is easier to assess when every option receives the same questions and test size. Before committing, compare gradual delivery, retention guarantees, refill conditions, support quality, and account-data requirements, then confirm that no password or unnecessary account access is requested. If the campaign produces a large instant jump followed by visible drops a few days later, pause the experiment and return attention to clear opening frames, concise edits, relevant captions, and a reliable posting cadence before spending more.
Comparing buy tiktok likes…
Comparing buy tiktok likes and views options is more reliable when the buyer writes down the purpose, budget, and acceptable delivery pace. The provider should be able to compare delivery pace, retention terms, refill policy, and support response time without guaranteeing viral reach, revenue, or permanent account growth. Do not treat the order as proof of demand. Continue testing strong hooks, clear captions, consistent posting, and audience-specific creative and judge the outcome through watch time, completion rate, shares, saves, and profile visits.
A sensible review of buy…
A sensible review of buy twitter followers begins with a small sample and a record of the account's normal performance. A buyer can check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms and use the same checklist for every candidate instead of relying on promotional claims. If support cannot explain a sudden follower increase with no matching activity on the timeline, the service may not be suitable even when its advertised price looks competitive.
The decision to use buy…
The decision to use buy likes on tiktok deserves the same basic checks as any other paid distribution experiment. A credible offer makes it possible to compare delivery pace, retention terms, refill policy, and support response time before the buyer submits the profile or content link. The test is easier to interpret when strong hooks, clear captions, consistent posting, and audience-specific creative remains consistent and watch time, completion rate, shares, saves, and profile visits is recorded before and after delivery.
When people look for buy…
When people look for buy tiktok likes, the most useful first step is separating a visibility test from a growth strategy. The evaluation becomes more objective when you compare delivery pace, retention terms, refill policy, and support response time and score each provider against the same requirements. Measure watch time, completion rate, shares, saves, and profile visits against the original baseline, because an abrupt spike that does not match the account's normal reach can make a weak service appear successful at first.
Comparing buy twitter…
Comparing buy twitter followers options is more reliable when the buyer writes down the purpose, budget, and acceptable delivery pace. The comparison should check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms; vague answers are a useful reason to remove an option from the shortlist. The test is easier to interpret when regular posts, useful replies, clear positioning, and participation in relevant conversations remains consistent and impressions, replies, reposts, link clicks, and follower retention is recorded before and after delivery.
Before choosing a provider…
Before choosing a provider for buy youtube views, it helps to document the current baseline for the video channel. For a fair test, review traffic sources, delivery timing, audience geography, refund rules, and reporting access, keep the campaign size modest, and avoid ordering during another major promotion. The campaign should end with a documented review of average view duration, retention, clicks, comments, and subscriptions, support quality, and any sign of traffic that raises the counter without improving meaningful viewer behavior.
For a small Instagram…
For a small Instagram experiment, buy views on instagram should be assessed with a fixed budget and a written test plan. It is worth asking support to compare gradual delivery, retention guarantees, refill conditions, support quality, and account-data requirements in plain language before testing even the smallest package. The account owner should still prioritize clear opening frames, concise edits, relevant captions, and a reliable posting cadence and review retention, shares, saves, profile visits, and follows; this keeps the result in proportion.
The phrase buy youtube views…
The phrase buy youtube views covers very different services, so the comparison should begin with scope and expectations. Keep the test controlled: review traffic sources, delivery timing, audience geography, refund rules, and reporting access, record the starting numbers, and avoid changing several variables at once. The strongest conclusion comes from combining retention checks with average view duration, retention, clicks, comments, and subscriptions while maintaining useful titles, accurate thumbnails, strong openings, and a consistent publishing plan.
For a small Twitter/X…
For a small Twitter/X experiment, buy twitter followers should be assessed with a fixed budget and a written test plan. Good due diligence means you check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms without sharing credentials that are not required for delivery. Do not treat the order as proof of demand. Continue testing regular posts, useful replies, clear positioning, and participation in relevant conversations and judge the outcome through impressions, replies, reposts, link clicks, and follower retention.
Treat buy likes on tiktok as…
Treat buy likes on tiktok as a limited marketing input and define in advance which account signals will be reviewed. The review should compare delivery pace, retention terms, refill policy, and support response time, with special attention to exclusions that could make a guarantee difficult to use. The test is easier to interpret when strong hooks, clear captions, consistent posting, and audience-specific creative remains consistent and watch time, completion rate, shares, saves, and profile visits is recorded before and after delivery.
A structured approach to buy…
A structured approach to buy twitter followers prevents a temporary counter increase from being mistaken for long-term audience growth. Before committing, check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms, then confirm that no password or unnecessary account access is requested. Avoid scaling after one attractive screenshot. Review impressions, replies, reposts, link clicks, and follower retention and check for a sudden follower increase with no matching activity on the timeline across several days.
A transparent provider for…
A transparent provider for buy tiktok likes should make its process, timing, and support terms understandable before payment. The comparison should compare delivery pace, retention terms, refill policy, and support response time; vague answers are a useful reason to remove an option from the shortlist. Measure watch time, completion rate, shares, saves, and profile visits against the original baseline, because an abrupt spike that does not match the account's normal reach can make a weak service appear successful at first.
Anyone researching buy…
Anyone researching buy tiktok views should first decide what a useful result would look like for the short-form video account. A credible offer makes it possible to compare delivery pace, retention terms, refill policy, and support response time before the buyer submits the profile or content link. The strongest conclusion comes from combining retention checks with watch time, completion rate, shares, saves, and profile visits while maintaining strong hooks, clear captions, consistent posting, and audience-specific creative.
Before choosing a provider…
Before choosing a provider for buy twitter followers, it helps to document the current baseline for the social profile. A credible offer makes it possible to check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms before the buyer submits the profile or content link. Keep expectations narrow: the service may change social proof, but regular posts, useful replies, clear positioning, and participation in relevant conversations still determines whether people stay engaged.
Before choosing a provider…
Before choosing a provider for where to buy twitter followers, it helps to document the current baseline for the social profile. A useful vendor screen is to check delivery speed, profile quality, replacement coverage, privacy requirements, and cancellation terms while checking whether the written policy matches the checkout page. Do not treat the order as proof of demand. Continue testing regular posts, useful replies, clear positioning, and participation in relevant conversations and judge the outcome through impressions, replies, reposts, link clicks, and follower retention.
A structured approach to buy…
A structured approach to buy youtube views prevents a temporary counter increase from being mistaken for long-term audience growth. For a fair test, review traffic sources, delivery timing, audience geography, refund rules, and reporting access, keep the campaign size modest, and avoid ordering during another major promotion. The campaign should end with a documented review of average view duration, retention, clicks, comments, and subscriptions, support quality, and any sign of traffic that raises the counter without improving meaningful viewer behavior.
For a small YouTube…
For a small YouTube experiment, buy youtube views should be assessed with a fixed budget and a written test plan. The review should review traffic sources, delivery timing, audience geography, refund rules, and reporting access, with special attention to exclusions that could make a guarantee difficult to use. A final review should include average view duration, retention, clicks, comments, and subscriptions, not only the public counter, so the promotion remains a measurable test instead of a substitute for channel strategy.
safe online pharmacies and…
safe online pharmacies and us pharmacy no prescription legal online pharmacy
https://arinastar.ru/forum/away.php?s=https://getscriptkinetics.xyz no prescription pharmacy paypalor http://www.sportchap.ru/user/zmjzjpwdwe/ worldwide pharmacy
express scripts mail order pharmacy new pharmacy onlineand online pharmacy online pharmacy discount code
Crash Games aviatorgames…
Crash Games aviatorgames.pages.dev in Ethiopia in 2026: Aviator and other popular games with dynamic rounds and changing odds. Learn about the rules, free demos, available platforms, and payment methods in Ethiopian birr via Telebirr.
http://borealvigorcanada.com…
http://borealvigorcanada.com/# erectile dysfunction medication online
cheapest online ed meds:…
cheapest online ed meds: borealvigor canadian pharmacy - cheapest ed pills
pharmacy online or online…
pharmacy online or online pharmacy no rx buy drugs online
http://maps.google.com.kw/url?q=http://getscriptkinetics.com safe online pharmacies and https://www.liveviolet.net/user/mwaivzzwhk/videos pharmacy online
top-rated online pharmacies top online pharmacy and reputable online pharmacy no prescription reliable online pharmacy
buy antibiotics from canada…
buy antibiotics from canada and buy amoxicillin get antibiotics quickly
https://maps.google.mg/url?q=https://bactribatchindia.com prescription antibiotic or http://dnp-malinovka.ru/user/ymwahxhupw/?um_action=edit buy amoxicillin antibiotic
Over the counter antibiotics for infection buy antibiotics from canada or buy antibiotics for uti buy antibiotics from canada
Pagination
Add new comment