Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_cfg_common
Commits
61e34afc
Commit
61e34afc
authored
1 year ago
by
Eric Bremner
Committed by
Lily Yan
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-6342: compelting the tags to uw landing pages
parent
cddbb5aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!365
ISTWCMS-6342: updating taxonomy terms to use UW landing pages
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Service/UwNodeFieldValue.php
+43
-7
43 additions, 7 deletions
src/Service/UwNodeFieldValue.php
with
43 additions
and
7 deletions
src/Service/UwNodeFieldValue.php
+
43
−
7
View file @
61e34afc
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment