Posts

Showing posts from September, 2017

D8 - Derive the route_name for the views created page

You can derive the views route_name from the below pattern view.{view_id}.{display_id} {view_id} - Basically the machine name appears in the URL when you edit the view. {display_id} - Hope the tab of every display to find the display ID(eg., page_1, page_2 etc.,)

D8 - Programmatically Redirect in Custom module

Use the below code use Symfony\Component\HttpFoundation\RedirectResponse; use Drupal\Core\Url; return new RedirectResponse(\Drupal::url('{route_name}')); {route_name} - Name given while defining the path in .routing file. To derive the route_name of a views created page refer the below link, http://romelchrist.blogspot.com/2017/09/d8-derive-routename-for-views-created.html

D8 - How to Get Current node object in content view/edit page

$current_node = \Drupal::routeMatch()->getParameter('node');