Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
uw_fdsu_theme_resp
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_fdsu_theme_resp
Commits
6f3cefed
Commit
6f3cefed
authored
3 years ago
by
Eric Bremner
Committed by
Eric Bremner
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-4704: updating a lot of things to use featured image
parent
17a39317
No related branches found
No related tags found
1 merge request
!34
ISTWCMS-4847: adding preprocess to main content area to add classes for 404...
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
templates/container/container.html.twig
+4
-4
4 additions, 4 deletions
templates/container/container.html.twig
templates/node/node.html.twig
+0
-8
0 additions, 8 deletions
templates/node/node.html.twig
uw_fdsu_theme_resp.theme
+6
-23
6 additions, 23 deletions
uw_fdsu_theme_resp.theme
with
10 additions
and
35 deletions
templates/container/container.html.twig
+
4
−
4
View file @
6f3cefed
...
@@ -27,10 +27,10 @@
...
@@ -27,10 +27,10 @@
%}
%}
{%
if
header_data
%}
{%
if
header_data
%}
<div
class=
"
layout uw-contained-width
"
>
<div
class=
"
node--type-
{{
node_type
}}
"
>
{%
include
'@components/card/card--
teaser
/card--
teaser
.twig'
with
{
{%
include
'@components/card/card--
node
/card--
node
.twig'
with
{
'
teaser
'
:
header_data
,
'
node
'
:
header_data
,
'
type'
:
'header'
,
'
featured_image'
:
featured_image
,
}
%}
}
%}
</div>
</div>
{%
endif
%}
{%
endif
%}
...
...
This diff is collapsed.
Click to expand it.
templates/node/node.html.twig
+
0
−
8
View file @
6f3cefed
...
@@ -87,14 +87,6 @@
...
@@ -87,14 +87,6 @@
{{
attach_library
(
'seven/classy.node'
)
}}
{{
attach_library
(
'seven/classy.node'
)
}}
{%
if
view_mode
==
'full'
%}
{%
if
node_data.sources
%}
{%
set
featured_image
=
'yes'
%}
{%
else
%}
{%
set
featured_image
=
'no'
%}
{%
endif
%}
{%
endif
%}
{%
embed
'@layouts/node/node.twig'
with
{
{%
embed
'@layouts/node/node.twig'
with
{
'classes'
:
classes
,
'classes'
:
classes
,
'has_sidebar'
:
sidebar
?
'Yes'
:
'No'
'has_sidebar'
:
sidebar
?
'Yes'
:
'No'
...
...
This diff is collapsed.
Click to expand it.
uw_fdsu_theme_resp.theme
+
6
−
23
View file @
6f3cefed
...
@@ -378,6 +378,7 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) {
...
@@ -378,6 +378,7 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) {
in_array
(
$variables
[
'node'
]
->
getType
(),
$nodes_to_preprocess
))
{
in_array
(
$variables
[
'node'
]
->
getType
(),
$nodes_to_preprocess
))
{
$variables
[
'node_data'
]
=
$uwService
->
uwGetNodeContent
(
$variables
[
'node'
],
'full'
,
'all'
);
$variables
[
'node_data'
]
=
$uwService
->
uwGetNodeContent
(
$variables
[
'node'
],
'full'
,
'all'
);
$variables
[
'node_data'
][
'content'
]
=
$variables
[
'content'
];
$variables
[
'node_data'
][
'content'
]
=
$variables
[
'content'
];
$variables
[
'featured_image'
]
=
$uwService
->
uwCheckNodeForFeaturedImage
(
$variables
[
'node'
]);
}
}
// Unset the content variable, so that we do not get
// Unset the content variable, so that we do not get
...
@@ -410,29 +411,7 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) {
...
@@ -410,29 +411,7 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) {
// The UW service object.
// The UW service object.
$uwService
=
\Drupal
::
service
(
'uw_cfg_common.uw_service'
);
$uwService
=
\Drupal
::
service
(
'uw_cfg_common.uw_service'
);
// Set the node type.
$variables
[
'featured_image'
]
=
$uwService
->
uwCheckNodeForFeaturedImage
(
$node
);
$node_type
=
$node
->
getType
();
// Get the list of content types that are allowed to have
// feature images from our service.
$featured_image
=
$uwService
->
uwGetFeaturedImageContentTypes
();
// If node is allowed to have a featured image, make sure that
// node actually has an image.
if
(
in_array
(
$node_type
,
array_keys
(
$featured_image
)))
{
// Get the field name.
$field_name
=
$featured_image
[
$node_type
];
// Get the image object values from the node.
$image
=
$node
->
$field_name
->
getValue
();
// If there is an image present, set the variable so that
// the page title will not be displayed.
if
(
$image
)
{
$variables
[
'featured_image'
]
=
TRUE
;
}
}
}
}
}
}
...
@@ -526,6 +505,10 @@ function uw_fdsu_theme_resp_preprocess_container(&$variables) {
...
@@ -526,6 +505,10 @@ function uw_fdsu_theme_resp_preprocess_container(&$variables) {
// Get the node object.
// Get the node object.
$node
=
\Drupal
::
routeMatch
()
->
getParameter
(
'node'
);
$node
=
\Drupal
::
routeMatch
()
->
getParameter
(
'node'
);
// Set variables for featured image.
$variables
[
'node_type'
]
=
str_replace
(
'_'
,
'-'
,
$node
->
getType
());
$variables
[
'featured_image'
]
=
$uwService
->
uwCheckNodeForFeaturedImage
(
$node
);
// If there is a node object, get the header and footer data.
// If there is a node object, get the header and footer data.
if
(
$node
)
{
if
(
$node
)
{
$variables
[
'header_data'
]
=
$uwService
->
uwGetNodeContent
(
$node
,
'teaser'
,
'header'
);
$variables
[
'header_data'
]
=
$uwService
->
uwGetNodeContent
(
$node
,
'teaser'
,
'header'
);
...
...
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