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
b819bab2
Commit
b819bab2
authored
2 years ago
by
Martin Leblanc
Committed by
Eric Bremner
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-5709: removing the author from the teaser for news and blog
parent
ebf36656
No related branches found
No related tags found
1 merge request
!264
ISTWCMS-5709: removing the author from the teaser for news and blog
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Service/UwNodeContent.php
+24
-12
24 additions, 12 deletions
src/Service/UwNodeContent.php
with
24 additions
and
12 deletions
src/Service/UwNodeContent.php
+
24
−
12
View file @
b819bab2
...
...
@@ -54,11 +54,11 @@ class UwNodeContent {
switch
(
$node
->
getType
())
{
case
'uw_ct_blog'
:
$content_data
=
$this
->
getBlogContent
(
$node_flags
);
$content_data
=
$this
->
getBlogContent
(
$node_flags
,
$view_mode
);
break
;
case
'uw_ct_event'
:
$content_data
=
$this
->
getEventContent
(
$node_flags
);
$content_data
=
$this
->
getEventContent
(
$node_flags
,
$view_mode
);
break
;
case
'uw_ct_expand_collapse_group'
:
...
...
@@ -66,7 +66,7 @@ class UwNodeContent {
break
;
case
'uw_ct_news_item'
:
$content_data
=
$this
->
getNewsContent
(
$node_flags
);
$content_data
=
$this
->
getNewsContent
(
$node_flags
,
$view_mode
);
break
;
case
'uw_ct_web_page'
:
...
...
@@ -237,21 +237,26 @@ class UwNodeContent {
*
* @param array $node_flags
* The flags for the node.
* @param string $view_mode
* The view mode of the node.
*
* @return array
* Array of content to get from the node.
*/
public
function
getBlogContent
(
array
$node_flags
):
array
{
public
function
getBlogContent
(
array
$node_flags
,
string
$view_mode
):
array
{
// Get the content data.
$content_data
=
$this
->
setupContentData
(
$node_flags
);
// Setup the header content.
if
(
$node_flags
[
'get_header'
])
{
$content_data
[
'header'
][
'date'
]
=
$this
->
addToContentData
(
'date'
,
'field_uw_blog_date'
);
$content_data
[
'header'
][
'author'
]
=
$this
->
addToContentData
(
'author'
,
'field_author'
);
if
(
$view_mode
==
'teaser'
)
{
$content_data
[
'header'
][
'date'
]
=
$this
->
addToContentData
(
'date'
,
'field_uw_blog_date'
);
}
else
{
$content_data
[
'header'
][
'date'
]
=
$this
->
addToContentData
(
'date'
,
'field_uw_blog_date'
);
$content_data
[
'header'
][
'author'
]
=
$this
->
addToContentData
(
'author'
,
'field_author'
);
}
}
// Get the media.
if
(
$node_flags
[
'get_media'
])
{
$content_data
[
'media'
]
=
$this
->
addToContentData
(
'media'
,
NULL
);
...
...
@@ -290,7 +295,8 @@ class UwNodeContent {
*
* @param array $node_flags
* The flags for the node.
*
* @param string $view_mode
* The view mode of the node.
* @return array
* Array of content to get from the node.
*/
...
...
@@ -382,20 +388,26 @@ class UwNodeContent {
*
* @param array $node_flags
* The flags for the node.
*
* @param string $view_mode
* The view mode of the node.
* @return array
* Array of content to get from the node.
*/
public
function
getNewsContent
(
array
$node_flags
):
array
{
public
function
getNewsContent
(
array
$node_flags
,
string
$view_mode
):
array
{
// Get the content data.
$content_data
=
$this
->
setupContentData
(
$node_flags
);
// Setup the header content.
if
(
$node_flags
[
'get_header'
])
{
$content_data
[
'header'
][
'date'
]
=
$this
->
addToContentData
(
'date'
,
'field_uw_news_date'
);
if
(
$view_mode
==
'teaser'
)
{
$content_data
[
'header'
][
'date'
]
=
$this
->
addToContentData
(
'date'
,
'field_uw_news_date'
);
}
else
{
$content_data
[
'header'
][
'date'
]
=
$this
->
addToContentData
(
'date'
,
'field_uw_news_date'
);
$content_data
[
'header'
][
'author'
]
=
$this
->
addToContentData
(
'author'
,
'field_author'
);
}
}
// Get the media.
if
(
$node_flags
[
'get_media'
])
{
$content_data
[
'media'
]
=
$this
->
addToContentData
(
'media'
,
NULL
);
...
...
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