Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How will you create a new content type using code?



How will you create a new content type using code?..

Answer / Mohammad Yusuf

To create a new content type programmatically in Drupal, you can use the ContentTypeManager service. Here's an example:
```php
use DrupalnodeEntityContentType;
$content_type = ContentType::create([
'id' => 'my_custom_ct',
'label' => t('My Custom Content Type'),
]);
$content_type->save();

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Drupal Interview Questions

What is difference between drupal 7 and 8?

1 Answers  


Why Drupal is considered powerful CMS compare to other CMS system?

1 Answers  


Why should I use drupal?

1 Answers  


How to use preprocess function?

1 Answers  


What does drupal do?

1 Answers  


How will you create custom entity?

1 Answers  


What is the use of Rate field while setting up taxes?

1 Answers  


How do I remove breadcrumbs from my drupal pages?

1 Answers  


What is triage?

1 Answers  


Which files are required for theme?

1 Answers  


Explain what is drupal weight?

1 Answers  


What is api in drupal?

1 Answers  


Categories