Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_custom_blocks
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_custom_blocks
Commits
02ee2219
Commit
02ee2219
authored
8 months ago
by
Eric Bremner
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-6860: fix the event styling for automatic list block
parent
ffb05080
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!247
ISTWCMS-6860: fix the event styling for automatic list block
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Service/UwBlockAutoRender.php
+20
-11
20 additions, 11 deletions
src/Service/UwBlockAutoRender.php
with
20 additions
and
11 deletions
src/Service/UwBlockAutoRender.php
+
20
−
11
View file @
02ee2219
...
...
@@ -369,21 +369,25 @@ class UwBlockAutoRender {
if
(
isset
(
$config
[
'date'
]))
{
$date
=
$config
[
'date'
];
if
(
$date
===
'now'
)
{
// Use event_block_current block display.
$
view
->
setDisplay
(
'event_block_current'
)
;
$
display_id
=
'event_block_current'
;
}
elseif
(
$date
===
'past'
)
{
// Use event_block_past block display.
$
view
->
setDisplay
(
'event_block_past'
)
;
$
display_id
=
'event_block_past'
;
}
elseif
(
$date
===
'all'
)
{
// Use event_block_all block display.
$
view
->
setDisplay
(
'event_block_all'
)
;
$
display_id
=
'event_block_all'
;
}
elseif
(
$date
===
'range'
)
{
if
(
isset
(
$config
[
'from'
])
&&
isset
(
$config
[
'to'
]))
{
// Use event_block_range block display.
$
view
->
setDisplay
(
'event_block_range'
)
;
$
display_id
=
'event_block_range'
;
// Get 'from' and 'to' inputs.
$from
=
gmdate
(
"Y-m-d"
,
$config
[
'from'
]
->
getTimestamp
());
...
...
@@ -412,9 +416,12 @@ class UwBlockAutoRender {
}
// For existing site without date field.
else
{
$
view
->
setDisplay
(
'events_listing_block'
)
;
$
display_id
=
'events_listing_block'
;
}
// Set the display id for the view.
$view
->
setDisplay
(
$display_id
);
// The filters to be used in the view.
$filters_to_use
=
[
'tags'
=>
'field_uw_event_tags_target_id'
,
...
...
@@ -456,13 +463,15 @@ class UwBlockAutoRender {
// Execute the view.
$view
->
execute
();
// Get the render array.
// Return the render array for the view.
return
[
'#theme'
=>
'uw_block_views_list'
,
'#items'
=>
[
'view'
=>
$view
->
render
(),
'type'
=>
'view'
,
],
'#type'
=>
'view'
,
'#name'
=>
'view_name'
,
'#view'
=>
$view
,
'#display_id'
=>
$display_id
,
'#embed'
=>
TRUE
,
'#cache'
=>
$view
->
getCacheTags
(),
];
}
...
...
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