Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
WCMS
uw_sites_all
Commits
c4ab5c10
Commit
c4ab5c10
authored
May 22, 2020
by
Lily Yan
Browse files
ISTWCMS-3825 Add Feed: Web-resources news
parent
f771be63
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
0 deletions
+131
-0
config/install/core.entity_view_display.aggregator_feed.aggregator_feed.default.yml
..._view_display.aggregator_feed.aggregator_feed.default.yml
+39
-0
config/install/core.entity_view_display.aggregator_feed.aggregator_feed.summary.yml
..._view_display.aggregator_feed.aggregator_feed.summary.yml
+25
-0
config/install/core.entity_view_display.aggregator_item.aggregator_item.summary.yml
..._view_display.aggregator_item.aggregator_item.summary.yml
+21
-0
uw_sites_all.install
uw_sites_all.install
+46
-0
No files found.
config/install/core.entity_view_display.aggregator_feed.aggregator_feed.default.yml
0 → 100644
View file @
c4ab5c10
langcode
:
en
status
:
true
dependencies
:
module
:
-
aggregator
id
:
aggregator_feed.aggregator_feed.default
targetEntityType
:
aggregator_feed
bundle
:
aggregator_feed
mode
:
default
content
:
checked
:
type
:
timestamp_ago
weight
:
1
region
:
content
settings
:
{
}
third_party_settings
:
{
}
label
:
inline
description
:
weight
:
3
region
:
content
feed_icon
:
weight
:
5
region
:
content
image
:
weight
:
2
region
:
content
items
:
weight
:
0
region
:
content
link
:
type
:
uri_link
weight
:
4
region
:
content
settings
:
{
}
third_party_settings
:
{
}
label
:
inline
hidden
:
langcode
:
true
more_link
:
true
config/install/core.entity_view_display.aggregator_feed.aggregator_feed.summary.yml
0 → 100644
View file @
c4ab5c10
langcode
:
en
status
:
true
dependencies
:
config
:
-
core.entity_view_mode.aggregator_feed.summary
module
:
-
aggregator
id
:
aggregator_feed.aggregator_feed.summary
targetEntityType
:
aggregator_feed
bundle
:
aggregator_feed
mode
:
summary
content
:
items
:
weight
:
0
region
:
content
more_link
:
weight
:
1
region
:
content
hidden
:
checked
:
true
description
:
true
feed_icon
:
true
image
:
true
langcode
:
true
link
:
true
config/install/core.entity_view_display.aggregator_item.aggregator_item.summary.yml
0 → 100644
View file @
c4ab5c10
langcode
:
en
status
:
true
dependencies
:
config
:
-
core.entity_view_mode.aggregator_item.summary
module
:
-
aggregator
id
:
aggregator_item.aggregator_item.summary
targetEntityType
:
aggregator_item
bundle
:
aggregator_item
mode
:
summary
content
:
timestamp
:
weight
:
0
region
:
content
hidden
:
author
:
true
description
:
true
feed
:
true
langcode
:
true
link
:
true
uw_sites_all.install
0 → 100644
View file @
c4ab5c10
<?php
/**
* @file
* Install, update and uninstall for UW Sites all.
*/
use
Drupal\node\Entity\Node
;
use
Drupal\pathauto\PathautoState
;
/**
* Implements hook_install().
*/
function
uw_sites_all_install
()
{
// Add web resources news feed.
$title
=
'Web-resources news'
;
$fid
=
db_query
(
'SELECT fid FROM {aggregator_feed} WHERE title = :title'
,
array
(
':title'
=>
$title
))
->
fetchCol
();
if
(
empty
(
$fid
))
{
$feed
=
\
Drupal
::
entityTypeManager
()
->
getStorage
(
'aggregator_feed'
)
->
create
(
array
(
'uuid'
=>
\
Drupal
::
service
(
'uuid'
)
->
generate
(),
'title'
=>
$title
,
'url'
=>
'https://uwaterloo.ca/web-resources/news/news.xml'
,
'created'
=>
time
(),
));
$feed
->
save
();
}
}
/**
* Implements hook_uninstall().
*/
function
uw_sites_all_uninstall
()
{
$title
=
"Web-resources news"
;
$fid
=
db_query
(
'SELECT fid FROM {aggregator_feed} WHERE title = :title'
,
array
(
':title'
=>
$title
))
->
fetchCol
();
if
(
!
empty
(
$fid
))
{
db_delete
(
'aggregator_feed'
)
->
condition
(
'fid'
,
$fid
)
->
execute
();
db_delete
(
'aggregator_item'
)
->
condition
(
'fid'
,
$fid
)
->
execute
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment