By editor, 30 September, 2016 Edit and Update Entity schema on drupal 8 Tags Drupal 8 Code Entity Add a new field: Example 1 Automatic update: 1. Update baseFieldDefinitions() of the Entity. 2. Apply update from a mymodule_update_N(). Ex:
By editor, 30 September, 2016 Alter a view. Edit view result programmatically Tags Drupal 8 Code Views Drupal 9 Example : Change title
By editor, 30 September, 2016 Create HTML Table. render and theming Tags Drupal 8 Code Theming Example : Table. $header = ['#','Name', 'Mail']; $data = [ [1,'Name 1', 'Mail1@example.com'], [2,'Name NĀ°2', 'second@example.com'], ];
By editor, 29 September, 2016 Execute a drush command programmatically Tags Drupal 8 Code Drush Drupal 7 Methodes: drush_invoke (For the current site) drush_invoke($command, $arguments = array()); drush_invoke_process This creates a new process in a new Drupal instance. There for you must specify the site alias.
By editor, 27 September, 2016 Get Theme details (Name, Regions, Libraries ...) Tags Drupal 8 Code Theming Get current theme. $theme = \Drupal::theme()->getActiveTheme(); Theme name: $theme_name = \Drupal::theme()->getActiveTheme()->getName();
By editor, 26 September, 2016 Drupal 8 breadcrumb functions (menu_get_active_trail, and menu_link_get_preferred ...) Tags Drupal 8 Code Those functions [ menu_set_active_item(), menu_set_active_trail(), menu_get_active_trail(), menu_link_get_preferred() ] are removed on D8 and replaces with drupal 8 service. You can use following example to get data and to edit. Example :
By editor, 16 September, 2016 Drupal 8's HTML elements render and themes Tags Drupal 8 Code Theming Use custom twig template or alter an existence. Create a custom module then use hook_theme()
By editor, 1 September, 2016 Isset() VS Empty() VS Is_null() Tags PHP Code Those are three functions allow you to determine the nature of a variable, with a bit different. Comparison table
By editor, 29 August, 2016 Change Date format on Views BEF Tags Drupal 8 Code Drupal 7 Views There are several methodes. Change date format Using custom module.