Skip to content

Expandable page part#170

Merged
rosemcc merged 15 commits into
masterfrom
expandable-page-part
Nov 16, 2021
Merged

Expandable page part#170
rosemcc merged 15 commits into
masterfrom
expandable-page-part

Conversation

@rosemcc
Copy link
Copy Markdown
Contributor

@rosemcc rosemcc commented Nov 8, 2021

New feature for rich text / body media: Expandable Page Part

This is to handle a new page part content type in Contentful called 'Expand'. Expands can be used within rich text in a page entry. The Expand is itself a rich text field. Currently Expands cannot contain a nested Expand due to the field validation settings in Contentful, however this implementation would allow that use case if necessary. They can however, contain any other type of rich text entry (entries, assets, hyperlinks).

User story

As a content author I want to add collapsible sections to my page so that I can have long pages with subsections which readers will be able to easily skim and dip into as need dictates.

Implementation notes

  • New component: expandable-page-part
  • Graphql query GetExpandPartByIdGQL
  • Uses mat-expansion-panel
  • Uses ngx-contentful-rich-text and the body-media.service to render the rich text within the expansion component body
  • Uses the top 50 characters of the body text with an ellipsis for a summary/description on the expand panel
  • To optimise page loading time, lazy rendering is used so the panel content isn't rendered until the panel is opened

@rosemcc rosemcc requested a review from Trombach November 9, 2021 02:49
@rosemcc
Copy link
Copy Markdown
Contributor Author

rosemcc commented Nov 9, 2021

@Trombach ready to check :)

Copy link
Copy Markdown
Contributor

@Trombach Trombach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool. I like how the component loads the content itself instead of relying on the data being passed in! I've added one comment about the async request to bring it more in line with what I'm doing with the content page refactor. Take a look and let me know what you think 😄

Comment thread research-hub-web/src/styles.scss
@rosemcc rosemcc merged commit 1293be2 into master Nov 16, 2021
@rosemcc rosemcc deleted the expandable-page-part branch November 16, 2021 00:44
@rosemcc rosemcc mentioned this pull request Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants