Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e323086
Initial; based off service catalogue work
ahd44 May 6, 2026
7c466e4
Merge branch 'master' into andrew/add-community-hub
ahd44 May 7, 2026
69d582c
Basic setup refined, JS added for custom view visibility
ahd44 May 7, 2026
19fdef4
Improve JS code, hide user group legend
ahd44 May 8, 2026
bbc3223
WIP CSS and module changes
ahd44 May 11, 2026
bd6026e
WIP Working sync between filters and buttons
ahd44 May 11, 2026
9016324
Ensure content is not visible until loaded
ahd44 May 11, 2026
f6ef571
Refine configuration and styling
ahd44 May 12, 2026
3701fb5
Properly implement select all button
ahd44 May 12, 2026
1aa56f0
Refactor slightly, fix view error
ahd44 May 12, 2026
f8d1fa7
Suppress top scrolling behavior when filters change
ahd44 May 12, 2026
d1de58f
Ensure options deselected when page reloaded
ahd44 May 12, 2026
dbe44a2
Rename view
ahd44 May 12, 2026
6eaeb34
Adjust spacing of search button
ahd44 May 12, 2026
ab70b8d
Fix errors associated with earlier renaming
ahd44 May 12, 2026
41934c5
Further rename clean-up
ahd44 May 12, 2026
291411e
Update CSS
ahd44 May 12, 2026
9cffe19
Require image
ahd44 May 12, 2026
8c7e1b0
Ensure newly added resources look OK on stand-alone view
ahd44 May 12, 2026
8a852b1
Make menu tighter to accommodate new link and prevent wrapping
ahd44 May 13, 2026
b1e9110
Reorganize CSS, keep search button style when disabled
ahd44 May 13, 2026
3addd6b
Add hover styles for btn-check buttons
ahd44 May 18, 2026
b5178f7
Add support for introduction block to view
ahd44 May 18, 2026
a5405f0
Eliminate right arrow on button
ahd44 May 18, 2026
6447e84
Hide default page title
ahd44 May 18, 2026
829ef47
Hide breadcrumbs, increase spacing
ahd44 May 18, 2026
732589d
Change select all text to select none when all selected
ahd44 May 18, 2026
a9f33fc
Add README.md with installation instructions
ahd44 May 19, 2026
f53be7c
Add restricted-access field
ahd44 May 21, 2026
2325265
Hide group select filter with CSS instead of dynamically
ahd44 May 21, 2026
7fbf284
Adjust appearance of restricted access icon
ahd44 May 21, 2026
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
47 changes: 47 additions & 0 deletions modules/custom/cp_community_hub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Community Hub

## Setup instructions

Once installed/enabled, requires a specific page setup to render properly.

1) Create a new basic page. Set the desired URL alias and disable the TOC.
2) Body should have several elements, including a replacement `h1`, introductory text that is always displayed, and a `div` with the id `user-groups-container`. Ensure "Full HTML" is selected. Example content:

```html
<h1 class="text-center">
Welcome to the <span class="text-danger">ICOS Community Hub</span>!
</h1>
<p>
(placeholder for introductory text TBD)
</p>
<div class="w-100" id="user-groups-container">
<div class="fs-3 text-center">
Are you...?
</div>
</div>
```

3) Introduction should have the message that will be displayed immediately before the shown resource results. Example content:

```html
<p class="h4">
Here are some resources curated for you!
</p>
```

4) Upload a header image for the page.
5) Save page.
6) In the layout manager:
1) Add a new section at the bottom (e.g., "Light Blue Full Width (one column)")
2) Add block to bottom section -- select the "Community Hub Resources" view block.
3) Move the Introduction block from the top section to the bottom section, above the view block.
4) Add block to bottom section -- create content block, add text that should appear when no user group is selected, e.g. `Tell us what your role is, and we’ll show you what you need...`
5) Save layout.

## Create taxonomy terms for "User groups"

Go to `/admin/structure/taxonomy/manage/community_user_groups/overview` and add user groups. Reorder as desired.

## Add content

Add new content, select "Community resource".
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
langcode: en
status: true
dependencies:
config:
- node.type.community_resource
id: node.community_resource.title
field_name: title
entity_type: node
bundle: community_resource
label: 'Resource title'
description: ''
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
langcode: en
status: true
dependencies:
config:
- field.field.node.community_resource.body
- field.field.node.community_resource.field_cpcommhub_image
- field.field.node.community_resource.field_cpcommhub_link
- field.field.node.community_resource.field_cpcommhub_restricted
- field.field.node.community_resource.field_cpcommhub_scope
- field.field.node.community_resource.field_cpcommhub_user_groups
- field.field.node.community_resource.field_cpcommhub_weight
- node.type.community_resource
module:
- image
- link
- options
- path
- text
id: node.community_resource.default
targetEntityType: node
bundle: community_resource
mode: default
content:
title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_cpcommhub_user_groups:
type: options_buttons
weight: 3
region: content
settings: { }
third_party_settings: { }
field_cpcommhub_scope:
type: options_buttons
weight: 4
region: content
settings: { }
third_party_settings: { }
field_cpcommhub_image:
type: image_image
weight: 2
region: content
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
body:
type: text_textarea_with_summary
weight: 1
region: content
settings:
rows: 9
summary_rows: 3
placeholder: ''
show_summary: false
third_party_settings: { }
field_cpcommhub_link:
type: link_default
weight: 6
region: content
settings:
placeholder_url: ''
placeholder_title: 'Go to resource'
third_party_settings: { }
field_cpcommhub_restricted:
type: boolean_checkbox
weight: 5
region: content
settings:
display_label: true
third_party_settings: { }
field_cpcommhub_weight:
type: number
weight: 7
region: content
settings: { }
third_party_settings: { }
uid:
type: entity_reference_autocomplete
weight: 8
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
created:
type: datetime_timestamp
weight: 9
region: content
settings: { }
third_party_settings: { }
status:
type: boolean_checkbox
weight: 10
region: content
settings:
display_label: true
third_party_settings: { }
path:
type: path
weight: 11
region: content
settings: { }
third_party_settings: { }
promote:
type: boolean_checkbox
weight: 12
region: content
settings:
display_label: true
third_party_settings: { }
sticky:
type: boolean_checkbox
weight: 13
region: content
settings:
display_label: true
third_party_settings: { }
hidden: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
langcode: en
status: true
dependencies:
config:
- field.field.node.community_resource.body
- field.field.node.community_resource.field_cpcommhub_image
- field.field.node.community_resource.field_cpcommhub_link
- field.field.node.community_resource.field_cpcommhub_scope
- field.field.node.community_resource.field_cpcommhub_user_groups
- field.field.node.community_resource.field_cpcommhub_weight
- node.type.community_resource
module:
- image
- link
- text
- user
id: node.community_resource.default
targetEntityType: node
bundle: community_resource
mode: default
content:
field_cpcommhub_image:
type: image
label: hidden
settings:
image_link: ''
image_style: ''
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
body:
type: text_default
label: hidden
settings: { }
third_party_settings: { }
weight: 1
region: content
field_cpcommhub_link:
type: link
label: hidden
settings:
trim_length: 80
url_only: true
url_plain: true
rel: '0'
target: '0'
third_party_settings: { }
weight: 2
region: content
field_cpcommhub_user_groups:
type: entity_reference_label
label: above
settings:
link: false
third_party_settings: { }
weight: 4
region: content
field_cpcommhub_scope:
type: list_default
label: above
settings: { }
third_party_settings: { }
weight: 5
region: content
hidden:
field_cpcommhub_weight: true
links: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.community_resource.body
- field.field.node.community_resource.field_cpcommhub_image
- field.field.node.community_resource.field_cpcommhub_link
- field.field.node.community_resource.field_cpcommhub_restricted
- field.field.node.community_resource.field_cpcommhub_scope
- field.field.node.community_resource.field_cpcommhub_user_groups
- field.field.node.community_resource.field_cpcommhub_weight
- node.type.community_resource
module:
- image
- link
- text
- user
id: node.community_resource.teaser
targetEntityType: node
bundle: community_resource
mode: teaser
content:
field_cpcommhub_image:
type: image
label: hidden
settings:
image_link: ''
image_style: ''
image_loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
body:
type: text_summary_or_trimmed
label: hidden
settings:
trim_length: 200
third_party_settings: { }
weight: 1
region: content
field_cpcommhub_link:
type: link
label: hidden
settings:
trim_length: 80
url_only: true
url_plain: true
rel: '0'
target: '0'
third_party_settings: { }
weight: 2
region: content
links:
settings: { }
third_party_settings: { }
weight: 4
region: content
hidden:
field_cpcommhub_restricted: true
field_cpcommhub_scope: true
field_cpcommhub_user_groups: true
field_cpcommhub_weight: true
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.body
- node.type.community_resource
module:
- text
id: node.community_resource.body
field_name: body
entity_type: node
bundle: community_resource
label: Description
description: 'A brief description of this resource and what it provides to the community.'
required: false
translatable: true
default_value: { }
default_value_callback: ''
settings:
display_summary: false
required_summary: false
allowed_formats: { }
field_type: text_with_summary
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_cpcommhub_image
- node.type.community_resource
module:
- image
id: node.community_resource.field_cpcommhub_image
field_name: field_cpcommhub_image
entity_type: node
bundle: community_resource
label: Image
description: 'Thumbnail image for this resource card. Minimum 512x288 pixels (16:9 aspect ratio).'
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: '[date:custom:Y]-[date:custom:m]'
file_extensions: 'png gif jpg jpeg webp'
max_filesize: ''
max_resolution: ''
min_resolution: 512x288
alt_field: true
alt_field_required: false
title_field: false
title_field_required: false
default_image:
uuid: ''
alt: ''
title: ''
width: null
height: null
field_type: image
Loading