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

[WIP] Investigating APTO vs bespoke page templates #127

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matt-bernhardt
Copy link
Member

This is part of the work toward LM-436, investigating how to implement custom post orders (via APTO or via custom page templates)

Developer

Stylesheets

  • Any theme or plugin whose stylesheets have changed has had its version
    string incremented.

Secrets

  • All new secrets have been added to Pantheon tiers
  • Relevant secrets have been updated in Github Actions
  • All new secrets documented in README

Documentation

  • Project documentation has been updated
  • No documentation changes are needed

Accessibility

  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)

Stakeholder approval

  • Stakeholder approval has been confirmed
  • Stakeholder approval is not needed

Dependencies

YES | NO dependencies are updated

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • The changes have been verified
  • The documentation has been updated or is unnecessary
  • New dependencies are appropriate or there were no changes

@matt-bernhardt
Copy link
Member Author

One of the code design questions I have about work like this is how best to structure a bespoke page template that has custom PHP code interspersed with Loop markup.

Prior to this PR, the page-exhibits-feed.php template uses PHP blocks in amongst markup. The commit I just pushed tries to refactor the template to define the various query arrays at the top of the template, prior to starting any markup. This should allow the rest of the template to only have output logic.

An alternative, for a page like this, would be to split the template into three partials - one for the Current, Future, and Past loops. I worry, though, that this will get flagged for code repetition (not that the linter is the final arbiter of quality, but there's a reason why you try to avoid repeating code).

These blocks are different enough that they might be acceptable - and the inside of the Loop here is already calling a shared exhibits-detail partial - so maybe this is okay.

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.

1 participant