By editor, 13 January, 2017 Create a field in a node entity programmatically on Drupal 8. Tags Drupal 8 Code Field Example. Step 1 : Create field storage. \Drupal\field\Entity\FieldStorageConfig::create(array( 'field_name' => 'field_text', 'entity_type' => 'node', 'type' => 'text', 'cardinality' => -1,
By editor, 12 January, 2017 CSS Styling tips for Print Tags Drupal 8 Code Add CSS for Print Method 1 : Add a specific styling sheet for Print. On your theme (THEME.info.yml for D8 and THEME.info for D7), Add css file as [print]. Example stylesheets[print][] = css/print.css
By editor, 11 January, 2017 Make Some operations Programmatically - Hook Update Deploy Tools Tags Drupal 8 Code Drupal 7 Module Hook Update Deploy Tools is a great contrib module help to make most of site deploy operations programmatically. Link : https://www.drupal.org/project/hook_update_deploy_tools
By editor, 10 January, 2017 Get Entity data and metadata Tags Drupal 8 Code Entity Get entity types list : $itmes_list= \Drupal::entityTypeManager()->getDefinitions(); Get Entity type (Content / Config) $itmes_list['node']->getGroup(); $itmes_list['node_type']->getGroup();
By editor, 3 January, 2017 Manage custom package using composer. Tags Drupal 8 Code Composer Composer can hadle CVS (git, svn ...) and ZIP packages. To install/Update your custom modules, add a custom repository to the composer.json file, following this example. 1. Add package repositories Here, youtubeapi and sadb