Skip to content

Commit

Permalink
Update engineering_magazine.module (#120)
Browse files Browse the repository at this point in the history
Removed pathauto alter so that regular pathauto pattern applies
  • Loading branch information
buttonwillowsix authored Aug 6, 2024
1 parent b45b987 commit 63fe5f6
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,3 @@ function engineering_magazine_theme($existing, $type, $theme, $path) {
],
];
}

/**
* Implements hook_pathauto_pattern_alter().
*/
function engineering_magazine_pathauto_pattern_alter(PathautoPattern &$pattern, array $context) {
// If a story is marked as a magazine story, it needs to get a magazine path.
if ($context['bundle'] == 'stanford_news' &&
($context['op'] == 'insert' || $context['op'] == 'update')) {

$node = $context['data']['node'];
if ($node->get('su_magazine_story')->value) {
$pattern->setPattern('magazine/[node:title]');
}
}
}

0 comments on commit 63fe5f6

Please sign in to comment.