Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VOTE-2071 Add voter guide listing view to voter guide page template #762

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 212 additions & 0 deletions config/sync/views.view.voter_guides.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
uuid: 6d9e37b2-cf77-4f47-990d-4df394a4d332
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- node.type.voter_guide
module:
- node
- user
id: voter_guides
label: 'Node: Voter Guides'
module: views
description: ''
tag: ''
base_table: node_field_data
base_field: nid
display:
default:
id: default
display_title: Default
display_plugin: default
position: 0
display_options:
title: ''
fields:
rendered_entity:
id: rendered_entity
table: node
field: rendered_entity
relationship: none
group_type: group
admin_label: ''
entity_type: node
plugin_id: rendered_entity
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: false
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
view_mode: teaser
pager:
type: none
options:
offset: 0
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
access:
type: perm
options:
perm: 'access content'
cache:
type: tag
options: { }
empty: { }
sorts:
created:
id: created
table: node_field_data
field: created
relationship: none
group_type: group
admin_label: ''
entity_type: node
entity_field: created
plugin_id: date
order: DESC
expose:
label: ''
field_identifier: ''
exposed: false
granularity: second
arguments: { }
filters:
status:
id: status
table: node_field_data
field: status
entity_type: node
entity_field: status
plugin_id: boolean
value: '1'
group: 1
expose:
operator: ''
type:
id: type
table: node_field_data
field: type
entity_type: node
entity_field: type
plugin_id: bundle
value:
voter_guide: voter_guide
style:
type: default
options:
grouping: { }
row_class: ''
default_row_class: false
row:
type: fields
options:
default_field_elements: false
inline: { }
separator: ''
hide_empty: false
query:
type: views_query
options:
query_comment: ''
disable_sql_rewrite: false
distinct: false
replica: false
query_tags: { }
relationships: { }
header: { }
footer: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_interface'
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:core.entity_view_display.node.landing.default'
- 'config:core.entity_view_display.node.landing.full'
- 'config:core.entity_view_display.node.landing.teaser'
- 'config:core.entity_view_display.node.nvrf_page.default'
- 'config:core.entity_view_display.node.nvrf_page.teaser'
- 'config:core.entity_view_display.node.page.default'
- 'config:core.entity_view_display.node.page.full'
- 'config:core.entity_view_display.node.page.teaser'
- 'config:core.entity_view_display.node.state_territory.default'
- 'config:core.entity_view_display.node.state_territory.full'
- 'config:core.entity_view_display.node.state_territory.teaser'
- 'config:core.entity_view_display.node.voter_guide.default'
- 'config:core.entity_view_display.node.voter_guide.full'
- 'config:core.entity_view_display.node.voter_guide.teaser'
embed_1:
id: embed_1
display_title: Embed
display_plugin: embed
position: 1
display_options:
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_interface'
- 'user.node_grants:view'
- user.permissions
tags:
- 'config:core.entity_view_display.node.landing.default'
- 'config:core.entity_view_display.node.landing.full'
- 'config:core.entity_view_display.node.landing.teaser'
- 'config:core.entity_view_display.node.nvrf_page.default'
- 'config:core.entity_view_display.node.nvrf_page.teaser'
- 'config:core.entity_view_display.node.page.default'
- 'config:core.entity_view_display.node.page.full'
- 'config:core.entity_view_display.node.page.teaser'
- 'config:core.entity_view_display.node.state_territory.default'
- 'config:core.entity_view_display.node.state_territory.full'
- 'config:core.entity_view_display.node.state_territory.teaser'
- 'config:core.entity_view_display.node.voter_guide.default'
- 'config:core.entity_view_display.node.voter_guide.full'
- 'config:core.entity_view_display.node.voter_guide.teaser'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="vote-feature-cards">
<h2 class="vote-feature-cards__header vote-heading--red-underline vote-heading--max-width">
{{ heading }}
</h2>
<ul class="usa-card-group">
{{ cards }}
</ul>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@
</div>
</div>
</main>
{# Voter guide listing #}
{{ drupal_view('voter_guides', 'embed_1') }}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<div class="vote-feature-cards">
<h2 class="vote-feature-cards__header vote-heading--red-underline vote-heading--max-width">
{{ content.field_heading | field_value }}
</h2>
<ul class="usa-card-group">
{{ content.field_cards | field_value }}
</ul>
</div>
{% include '@votegov/component/feature-cards.html.twig' with {
'heading': content.field_heading | field_value,
'cards': content.field_cards | field_value
} %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{#
/**
* @file
* Default theme implementation for main view template: voter_guides - embed_1.
*/
#}

{% if rows %}
{% include '@votegov/component/feature-cards.html.twig' with {
'heading': 'Voting Guides for specific audiences',
'cards': rows
} %}
{% endif %}