Skip to content

Register of interest page layout#2022

Open
lucascumsille wants to merge 7 commits into
masterfrom
register-of-interest-layout
Open

Register of interest page layout#2022
lucascumsille wants to merge 7 commits into
masterfrom
register-of-interest-layout

Conversation

@lucascumsille

@lucascumsille lucascumsille commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Fixes: #2015

The following changes have been made:

  • Register of interest page uses the same layout as the MP page. So we don't have two different styles that at the same cover similar layout out content.
  • Move the styling from in-page-nav to its own stylesheet. So we can reuse it in other pages.
  • Added a component .js-table-of-content-markdown that creates from the markdown a table of content with the proper classes so it can use the current functionality/styles of js-table-of-content
  • Added a newsletter and donation prompts to the sidebar, just like in the MP. Because the copy is different I decided to create new templates instead of all using the current templates.
Screenshot 2026-06-03 at 10 32 51 Note: the odd styling inside the newsletter should be fixes when merging [this previous PR needs](https://github.com//pull/2020)

@lucascumsille lucascumsille requested a review from ajparsons June 3, 2026 09:34
@ajparsons

Copy link
Copy Markdown
Contributor

So mostly looks good!

  • This will need a bit of changing after merging my changes to the other PR - as that changes the approach for specifying something as a newsletter page.
  • The static page donation/newsletter bubble are fairly similar to the ones in the MP page - I wonder about moving the display bit to sidebar/_donation.php etc - and then include that after loading the specific data for each location?

@lucascumsille

Copy link
Copy Markdown
Contributor Author

The static page donation/newsletter bubble are fairly similar to the ones in the MP page - I wonder about moving the display bit to sidebar/_donation.php etc - and then include that after loading the specific data for each location?

Just to clarify the styling is the same, however the content/copy is different. I'm happy to go with this approach if we can have different content in the MP and Register of Interest.

This will need a bit of changing after merging my changes to the other PR - as that changes the approach for specifying something as a newsletter page.

Perfect I'll rebase this one with master once we have merge this PR and make the changes.

@lucascumsille lucascumsille changed the base branch from master to 2012-newsletter-sign-up-mp June 9, 2026 11:04
@ajparsons ajparsons force-pushed the 2012-newsletter-sign-up-mp branch from 81d1041 to a9eaab8 Compare June 9, 2026 11:43
@lucascumsille lucascumsille changed the base branch from 2012-newsletter-sign-up-mp to master June 9, 2026 14:27
- Moved styles from the `_mp.scss` page to `_in-page-nav.scss`
- Fix wrong hierarchy markup in where the main title of the navigation was an `h3` element and then children were `h2`.
It creates a side menu from markdown template that uses the same classes as `.js-table-of-content` allowing the same style navigation we use in the MP pages.
@lucascumsille lucascumsille force-pushed the register-of-interest-layout branch 2 times, most recently from 90e4317 to f4b0914 Compare June 9, 2026 15:10
@lucascumsille lucascumsille force-pushed the register-of-interest-layout branch from f4b0914 to 0407f72 Compare June 9, 2026 15:28
- Deleted the first line on each template so they can be reused and the variable `$featured_item` and `newsletter_item` can have different copies.

- Updated `mp/_sidebar.php` so it uses the correct variable `$featured_item`
@lucascumsille

Copy link
Copy Markdown
Contributor Author

@ajparsons I just added two commits that follows the same logic for the announcements in the MP page.

I also included some commits to:

@lucascumsille

Copy link
Copy Markdown
Contributor Author

@ajparsons I think this should be ready for review:
JSON Example:

  {
    "title": "Support TheyWorkForYou",
    "content": "We are a charity - donate today to invest in making UK politics more transparent and accessible. <br> ♥️ Even £5 goes a long way!",
    "url": "https://www.mysociety.org/donate/",
    "button_text": "Donate now",
    "button_class": "button--negative",
    "location": ["sidebar_interests"],
    "type": "donation",
    "weight": 2,
    "published": true,
    "lang": "en",
    "start_time": "2025-01-01T00:00:00",
    "end_time": "2030-12-31T23:59:59"
  },
{
  "title": "Find out what else we do",
  "content": "Subscribe to our newsletter",
  "thumbnail_image_url": "https://www.mysociety.org/files/2026/03/wdtk-image-event.jpg",
  "thumbnail_image_alt_text": "",
  "url": "https://www.mysociety.org/subscribe/",
  "button_text": "Subscribe",
  "button_class": "button--primary",
  "location": ["sidebar_interests"],
  "type": "newsletter",  
  "footer_html": "<a href=\"https://www.mysociety.org/privacy#newsletter\">Your data and how we use it</a>",
  "weight": 3,
  "published": true,
  "lang": "en",
  "start_time": "2025-01-01T00:00:00",
  "end_time": "2030-12-31T23:59:59"
}

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.

[2009] On the Register of Interests page:

2 participants