Skip to content
Snippets Groups Projects
Commit 288a05b7 authored by Brian Canini's avatar Brian Canini
Browse files

event template and theme update

- setting up  variable to capture pathauto url alias in .theme
- updating event node taxonomy link to utilize pathauto variable
parent f9550a09
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,11 @@ function asc_bootstrap_preprocess_node(&$vars, $hook) {
$vars['site_mail'] = \Drupal::config('system.site')->get('mail');
$vars['site_name'] = \Drupal::config('system.site')->get('name');
//get pathauto url alias for event
$config = \Drupal::service('config.factory')->get('pathauto.pattern.events');
$evpattern = explode('/', $config->get('pattern'));
$vars['evpattern'] = $evpattern[0];
//get research landing page url alias
$nids = \Drupal::entityQuery('node')->condition('type','research_landing_page')->execute();
$lid = array_shift($nids);
......
......@@ -239,7 +239,7 @@
{% for item in content.field_evt_taxonomy %}
{% if item['#title'] %}
<div class="taxonomy-events">
<a href="/events?field_evt_taxonomy_target_id_1={{ item['#url']|render|split('/')|last }}">
<a href="/{{ evpattern }}?field_evt_taxonomy_target_id_1={{ item['#url']|render|split('/')|last }}">
{{ item['#title'] }}
</a>
</div>
......@@ -250,7 +250,7 @@
{% for item in content.field_evt_taxonomy2 %}
{% if item['#title'] %}
<div class="taxonomy-events">
<a href="/events?field_evt_taxonomy2_target_id={{ item['#url']|render|split('/')|last }}">
<a href="/{{ evpattern }}?field_evt_taxonomy2_target_id={{ item['#url']|render|split('/')|last }}">
{{ item['#title'] }}
</a>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment