Skip to content

Commit

Permalink
Refactor edit page detection
Browse files Browse the repository at this point in the history
  • Loading branch information
golddragon007 committed Nov 22, 2017
1 parent 0a50a0b commit 6c2fe58
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions parade.module
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ function parade_preprocess_paragraph(&$variables) {

// Some templates maybe needs to determinate it was called from an edit page
// or not.
$path = \Drupal::request()->getpathInfo();
$arg = explode('/',$path);
$route_name = Drupal::request()->attributes->get('_route');
$variables['isEditPage'] = FALSE;
if ($arg[3] == "edit") {
if ('entity.node.edit_form' === $route_name) {
$variables['isEditPage'] = TRUE;
}

Expand Down

0 comments on commit 6c2fe58

Please sign in to comment.