Skip to content

Commit 9da82c9

Browse files
committed
Refactor the 'homepage' to be a regular page plus blocks
Previously, the main page was generated by a view (as a 'page' display). This commit adds a blank page node at the same URL, deletes the no-longer-used page display of that view, and updates the block view to 1) match the appearance of the earlier approach and 2) be Tumblr-specific. The Tumblr feeds are aggregator sources 1 and 2, hence the filter for "less than or equal to 2". https://github.com/18F/nsf/issues/155 https://github.com/18F/nsf/issues/162
1 parent d89c786 commit 9da82c9

File tree

4 files changed

+266
-65
lines changed

4 files changed

+266
-65
lines changed

web/sites/default/config/block.block.nsf_page_title.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@ uuid: 1f8d24dc-a5d7-4f72-b183-4432efefea2b
22
langcode: en
33
status: true
44
dependencies:
5+
module:
6+
- system
57
theme:
68
- nsf
79
_core:
810
default_config_hash: 1TQP4b3ZnlzvIH9bj6cpCz_SyUHdJjLQkZnHpikjjhw
911
id: nsf_page_title
1012
theme: nsf
1113
region: content
12-
weight: -5
14+
weight: -8
1315
provider: null
1416
plugin: page_title_block
1517
settings:
1618
id: page_title_block
1719
label: 'Page title'
1820
provider: core
1921
label_display: '0'
20-
visibility: { }
22+
visibility:
23+
request_path:
24+
id: request_path
25+
pages: '<front>'
26+
negate: true
27+
context_mapping: { }
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
uuid: 12a04aa3-6f99-4beb-8dfc-59881beed555
2+
langcode: en
3+
status: true
4+
dependencies:
5+
config:
6+
- views.view.nsf_blog
7+
module:
8+
- system
9+
- views
10+
theme:
11+
- nsf
12+
id: views_block__nsf_blog_block_1
13+
theme: nsf
14+
region: content
15+
weight: -4
16+
provider: null
17+
plugin: 'views_block:nsf_blog-block_1'
18+
settings:
19+
id: 'views_block:nsf_blog-block_1'
20+
label: ''
21+
provider: views
22+
label_display: visible
23+
views_label: ''
24+
items_per_page: none
25+
visibility:
26+
request_path:
27+
id: request_path
28+
pages: '<front>'
29+
negate: false
30+
context_mapping: { }

web/sites/default/config/views.view.nsf_blog.yml

Lines changed: 74 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ dependencies:
55
module:
66
- aggregator
77
id: nsf_blog
8-
label: Blog
8+
label: 'External blogs'
99
module: views
10-
description: 'NSF custom view. Displays blog entries imported from external blog.'
10+
description: 'NSF custom view. Displays blog entries imported from external sources.'
1111
tag: ''
1212
base_table: aggregator_item
1313
base_field: iid
@@ -148,7 +148,20 @@ display:
148148
plugin_id: date
149149
title: 'NSF on Tumblr'
150150
header: { }
151-
footer: { }
151+
footer:
152+
area:
153+
id: area
154+
table: views
155+
field: area
156+
relationship: none
157+
group_type: group
158+
admin_label: ''
159+
empty: false
160+
tokenize: false
161+
content:
162+
value: '<a href="https://www.nsf.gov/social/policies.jsp">Social Media Policies</a>'
163+
format: basic_html
164+
plugin_id: text
152165
empty: { }
153166
relationships: { }
154167
arguments: { }
@@ -162,26 +175,19 @@ display:
162175
block_1:
163176
display_plugin: block
164177
id: block_1
165-
display_title: Block
178+
display_title: 'Tumblr block'
166179
position: 3
167180
display_options:
168181
display_extenders: { }
169-
style:
170-
type: default
171182
defaults:
172-
style: false
173-
row: false
174-
pager: false
183+
style: true
184+
row: true
185+
pager: true
175186
fields: false
176187
footer: true
177-
row:
178-
type: fields
179-
pager:
180-
type: some
181-
options:
182-
items_per_page: 5
183-
offset: 0
184-
block_description: 'Blog entries (all)'
188+
filters: false
189+
filter_groups: false
190+
block_description: 'NSF on Tumblr'
185191
fields:
186192
title:
187193
table: aggregator_item
@@ -314,6 +320,57 @@ display:
314320
entity_type: aggregator_item
315321
entity_field: timestamp
316322
plugin_id: field
323+
display_description: ''
324+
block_category: 'Social Media'
325+
filters:
326+
fid:
327+
id: fid
328+
table: aggregator_item
329+
field: fid
330+
relationship: none
331+
group_type: group
332+
admin_label: ''
333+
operator: '<='
334+
value:
335+
min: ''
336+
max: ''
337+
value: '2'
338+
group: 1
339+
exposed: false
340+
expose:
341+
operator_id: ''
342+
label: ''
343+
description: ''
344+
use_operator: false
345+
operator: ''
346+
identifier: ''
347+
required: false
348+
remember: false
349+
multiple: false
350+
remember_roles:
351+
authenticated: authenticated
352+
placeholder: ''
353+
min_placeholder: ''
354+
max_placeholder: ''
355+
is_grouped: false
356+
group_info:
357+
label: ''
358+
description: ''
359+
identifier: ''
360+
optional: true
361+
widget: select
362+
multiple: false
363+
remember: false
364+
default_group: All
365+
default_group_multiple: { }
366+
group_items: { }
367+
entity_type: aggregator_item
368+
entity_field: fid
369+
plugin_id: numeric
370+
filter_groups:
371+
operator: AND
372+
groups:
373+
1: AND
317374
cache_metadata:
318375
max-age: -1
319376
contexts:
@@ -338,52 +395,6 @@ display:
338395
path: blog.xml
339396
displays:
340397
default: default
341-
page_1: page_1
342-
cache_metadata:
343-
max-age: -1
344-
contexts:
345-
- 'languages:language_content'
346-
- 'languages:language_interface'
347-
tags: { }
348-
page_1:
349-
display_plugin: page
350-
id: page_1
351-
display_title: Page
352-
position: 1
353-
display_options:
354-
display_extenders: { }
355-
path: blog
356-
filters: { }
357-
defaults:
358-
filters: false
359-
filter_groups: false
360-
use_more: false
361-
use_more_always: false
362-
use_more_text: false
363-
title: true
364-
footer: false
365-
filter_groups:
366-
operator: AND
367-
groups:
368-
1: AND
369-
enabled: true
370-
use_more: false
371-
use_more_always: false
372-
use_more_text: more
373-
footer:
374-
area:
375-
id: area
376-
table: views
377-
field: area
378-
relationship: none
379-
group_type: group
380-
admin_label: ''
381-
empty: false
382-
tokenize: false
383-
content:
384-
value: '<a href="https://www.nsf.gov/social/policies.jsp">Social Media Policies</a>'
385-
format: basic_html
386-
plugin_id: text
387398
cache_metadata:
388399
max-age: -1
389400
contexts:
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
{
2+
"_links": {
3+
"self": {
4+
"href": "http:\/\/default\/blog?_format=hal_json"
5+
},
6+
"type": {
7+
"href": "http:\/\/drupal.org\/rest\/type\/node\/page"
8+
},
9+
"http:\/\/drupal.org\/rest\/relation\/node\/page\/revision_uid": [
10+
{
11+
"href": "http:\/\/default\/user\/1?_format=hal_json"
12+
}
13+
],
14+
"http:\/\/drupal.org\/rest\/relation\/node\/page\/uid": [
15+
{
16+
"href": "http:\/\/default\/user\/1?_format=hal_json",
17+
"lang": "en"
18+
}
19+
]
20+
},
21+
"nid": [
22+
{
23+
"value": 3
24+
}
25+
],
26+
"uuid": [
27+
{
28+
"value": "ce367652-adf0-41fb-ba60-bc548040cca3"
29+
}
30+
],
31+
"vid": [
32+
{
33+
"value": 3
34+
}
35+
],
36+
"langcode": [
37+
{
38+
"value": "en",
39+
"lang": "en"
40+
}
41+
],
42+
"type": [
43+
{
44+
"target_id": "page"
45+
}
46+
],
47+
"revision_timestamp": [
48+
{
49+
"value": "2018-05-04T23:24:09+00:00",
50+
"format": "Y-m-d\\TH:i:sP"
51+
}
52+
],
53+
"_embedded": {
54+
"http:\/\/drupal.org\/rest\/relation\/node\/page\/revision_uid": [
55+
{
56+
"_links": {
57+
"self": {
58+
"href": "http:\/\/default\/user\/1?_format=hal_json"
59+
},
60+
"type": {
61+
"href": "http:\/\/drupal.org\/rest\/type\/user\/user"
62+
}
63+
},
64+
"uuid": [
65+
{
66+
"value": "41754bd2-a1ed-4d85-afcd-d950e0e73015"
67+
}
68+
]
69+
}
70+
],
71+
"http:\/\/drupal.org\/rest\/relation\/node\/page\/uid": [
72+
{
73+
"_links": {
74+
"self": {
75+
"href": "http:\/\/default\/user\/1?_format=hal_json"
76+
},
77+
"type": {
78+
"href": "http:\/\/drupal.org\/rest\/type\/user\/user"
79+
}
80+
},
81+
"uuid": [
82+
{
83+
"value": "41754bd2-a1ed-4d85-afcd-d950e0e73015"
84+
}
85+
],
86+
"lang": "en"
87+
}
88+
]
89+
},
90+
"status": [
91+
{
92+
"value": true,
93+
"lang": "en"
94+
}
95+
],
96+
"title": [
97+
{
98+
"value": "National Science Foundation",
99+
"lang": "en"
100+
}
101+
],
102+
"created": [
103+
{
104+
"value": "2018-05-04T23:23:32+00:00",
105+
"lang": "en",
106+
"format": "Y-m-d\\TH:i:sP"
107+
}
108+
],
109+
"changed": [
110+
{
111+
"value": "2018-05-04T23:24:09+00:00",
112+
"lang": "en",
113+
"format": "Y-m-d\\TH:i:sP"
114+
}
115+
],
116+
"promote": [
117+
{
118+
"value": false
119+
}
120+
],
121+
"sticky": [
122+
{
123+
"value": false,
124+
"lang": "en"
125+
}
126+
],
127+
"default_langcode": [
128+
{
129+
"value": true,
130+
"lang": "en"
131+
}
132+
],
133+
"revision_translation_affected": [
134+
{
135+
"value": true,
136+
"lang": "en"
137+
}
138+
],
139+
"moderation_state": [
140+
{
141+
"value": "published",
142+
"lang": "en"
143+
}
144+
],
145+
"path": [
146+
{
147+
"alias": "\/blog",
148+
"pid": 2,
149+
"langcode": "en",
150+
"lang": "en"
151+
}
152+
]
153+
}

0 commit comments

Comments
 (0)