Skip to content
Snippets Groups Projects
Commit 61e34afc authored by Eric Bremner's avatar Eric Bremner Committed by Lily Yan
Browse files

ISTWCMS-6342: compelting the tags to uw landing pages

parent cddbb5aa
No related branches found
No related tags found
1 merge request!365ISTWCMS-6342: updating taxonomy terms to use UW landing pages
......@@ -705,6 +705,9 @@ class UwNodeFieldValue {
'uw_ct_event' => 'events',
'uw_ct_news_item' => 'news',
'uw_ct_opportunity' => 'opportunities',
'uw_ct_profile' => 'profiles',
'uw_ct_project' => 'projects/search',
'uw_ct_service' => 'services',
];
// Get the content type name.
......@@ -726,28 +729,61 @@ class UwNodeFieldValue {
'field_uw_opportunity_type' => 'opportunity_type',
'field_uw_opportunity_employment' => 'employment_type',
'field_uw_opportunity_pay_type' => 'rate_of_pay',
'field_uw_ct_profile_type' => 'type',
'field_uw_project_status' => 'status',
'field_uw_project_topics' => 'audience',
'field_uw_service_audience' => 'audience',
'field_uw_service_category' => 'categories',
];
// Step through each of the tags and get the
// correct url.
foreach ($tags as $index => $tag) {
// Start the url to the content type listing page.
$new_url = '/' . $content_type_list[$content_type];
$new_url .= '?';
// Start the url to the content type listing page, service
// category does not require the content type after the /.
if ($tag['field_name'] !== 'field_uw_service_category') {
$new_url = '/' . $content_type_list[$content_type];
}
else {
$new_url = '';
}
// If the tag is in the list of field names to convert,
// then convert them using the url provided, if not use
// the field name with tags.
if (array_key_exists($tag['field_name'], $tag_field_names)) {
$new_url .= $tag_field_names[$tag['field_name']];
// If this is not a service tag, add the query parameters.
// Services require a special url, so we will take care
// of that later.
if (
$tag['field_name'] !== 'field_uw_service_audience' &&
$tag['field_name'] !== 'field_uw_service_category'
) {
$new_url .= '?' . $tag_field_names[$tag['field_name']];
}
}
else {
$new_url .= 'tags';
$new_url .= '?tags';
}
// Add the tid to the new url.
$new_url .= '[' . $tag['tid'] . ']=' . $tag['tid'];
// Add the tid to the new url, projects status requires
// the non array for tid.
if ($tag['field_name'] == 'field_uw_project_status') {
$new_url .= '=' . $tag['tid'];
}
// If this is a service, just use the url to the term.
elseif (
$tag['field_name'] == 'field_uw_service_audience' ||
$tag['field_name'] == 'field_uw_service_category'
) {
$new_url .= $tag['url'];
}
// Add the array tid query parameter.
else {
$new_url .= '[' . $tag['tid'] . ']=' . $tag['tid'];
}
// Set the new url.
$tags[$index]['url'] = $new_url;
......
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