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

Add new Publications section for A Better Start #218

Merged
merged 3 commits into from
Mar 24, 2020

Conversation

mattandrews
Copy link
Contributor

@mattandrews mattandrews commented Mar 6, 2020

This has a few moving bits but is basically a better solution to all of the new content being published under A Better Start.

It does two things:

  1. Adds a new section called "Publications", which is basically arbitrary (flexible) content, associated with one (or more) funding/strategic programmes. This content can be tagged (with authors as well as content tags), a bit like blogposts, or can just consist of a single document/file. There's an API endpoint to fetch this content (grouped by the first programme the Publication is tagged with), and a second one to fetch all the content tags for a given programme (eg. to build a tag cloud).

image

  1. Adds a new field to Strategic Programmes called "Related content", which allows Publication entries above to be attached to a Strategic Programme in order to be displayed in a grid (see corresponding frontend PR).

image

$criteria['slug'] = $pageSlug;
}

$associatedProgramme = Entry::find()->section(['fundingProgrammes', 'strategicProgrammes'])->status(['live', 'expired'])->slug($programmeSlug)->site($locale)->one();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need expired in this list?

Copy link
Contributor

@davidrapson davidrapson left a comment

Choose a reason for hiding this comment

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

👍 Looks good. Wondering if we can share a bit of the logic between the research documents, but not essential here.


$associatedProgramme = Entry::find()->section(['fundingProgrammes', 'strategicProgrammes'])->status(['live', 'expired'])->slug($programmeSlug)->site($locale)->one();

$sortParam = \Craft::$app->request->getParam('sort');
Copy link
Contributor

Choose a reason for hiding this comment

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

This sort logic is the same as the research docs right? Worth us moving this to a helper method?

@mattandrews mattandrews merged commit 177cce6 into master Mar 24, 2020
@mattandrews mattandrews deleted the funding-publications branch March 24, 2020 11:47
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