Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_ct_service
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_ct_service
Commits
4f5f5f36
Commit
4f5f5f36
authored
3 years ago
by
Eric Bremner
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-5129: updating tabs for services
parent
d6b66f9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!60
ISTWCMS-6095 Update maxlength settings for title, text fields and link fields...
,
!25
ISTWCMS-5779 Click update button under...
,
!8
Feature/istwcms 5127 ebremner services blocks gui
,
!7
Feature/istwcms 5129 ebremner theme services views
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Form/ServiceSearchForm.php
+0
-5
0 additions, 5 deletions
src/Form/ServiceSearchForm.php
uw_ct_service.module
+10
-1
10 additions, 1 deletion
uw_ct_service.module
with
10 additions
and
6 deletions
src/Form/ServiceSearchForm.php
+
0
−
5
View file @
4f5f5f36
...
...
@@ -210,11 +210,6 @@ class ServiceSearchForm extends FormBase {
// in the form submit.
$form_state
->
set
(
'tid'
,
$url
[
3
]);
}
else
{
// Throw a Drupal error that there was no service to search.
$this
->
messenger
->
addError
(
'There is no specific service to be searched.'
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
uw_ct_service.module
+
10
−
1
View file @
4f5f5f36
...
...
@@ -143,6 +143,8 @@ function uw_ct_service_preprocess_views_view(&$variables)
// Putting the service search form into
// variables so that views template can use it.
if
(
in_array
(
$id
,
$services_ids
))
{
// Put the form into the variables.
$variables
[
'form_search'
]
=
\Drupal
::
formBuilder
()
->
getForm
(
'Drupal\uw_ct_service\Form\ServiceSearchForm'
);
// Get the current path and put into array based on
...
...
@@ -150,31 +152,38 @@ function uw_ct_service_preprocess_views_view(&$variables)
$current_path
=
\Drupal
::
service
(
'path.current'
)
->
getPath
();
$current_path_parts
=
explode
(
'/'
,
$current_path
);
// If we have something past /services add the tabs.
if
(
isset
(
$current_path_parts
[
2
]))
{
// Tab for Category.
$content_list
[]
=
[
'url'
=>
'/taxonomy/term/'
.
end
(
$current_path_parts
),
'text'
=>
'Category'
,
'active'
=>
strpos
(
$current_path
,
'/taxonomy/term/'
)
!==
false
?
1
:
0
,
];
// Tab for A-Z.
$content_list
[]
=
[
'url'
=>
'/services/all'
,
'text'
=>
'A-Z'
,
'active'
=>
$current_path
==
'/services/all'
?
1
:
0
,
];
// Tab for Audience.
$content_list
[]
=
[
'url'
=>
'/services/audience'
,
'text'
=>
'Audience'
,
'active'
=>
strpos
(
$current_path
,
'/services/audience/'
)
!==
false
?
1
:
0
,
];
// Tab for Popular.
$content_list
[]
=
[
'url'
=>
'/services/popular'
,
'text'
=>
'
Audience
'
,
'text'
=>
'
Popular
'
,
'active'
=>
strpos
(
$current_path
,
'/services/audience/'
)
!==
false
?
1
:
0
,
];
// Set the tabs in the variables.
$variables
[
'content_list'
]
=
$content_list
;
}
}
...
...
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