Skip to content

Commit

Permalink
Add donate link to top bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons authored and dracos committed Dec 15, 2023
1 parent 0515f89 commit 57ee306
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions classes/Renderer/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ private function addLoggedInLinks() {
);

$this->addContactLink();
$this->addDonateLink();
}

private function addLoggedOutLinks() {
Expand Down Expand Up @@ -163,6 +164,7 @@ private function addLoggedOutLinks() {

$this->addRepLinks();
$this->addContactLink();
$this->addDonateLink();
}

// add links to your MP etc if postcode set
Expand Down Expand Up @@ -207,4 +209,22 @@ private function addContactLink() {
);
}

private function addDonateLink() {
// In the long run, we should have a little page on this site and go through the normal metadata process
// for storing the link.

if (LANGUAGE == 'cy') {
$text = 'Cyfrannwch';
} else {
$text = 'Donate';
}

$this->data['user_nav_links'][] = array(
'href' => "https://www.mysociety.org/donate?utm_source=theyworkforyou.com&utm_content=top-bar&utm_medium=link&utm_campaign=mysoc_header",
'title' => $text,
'classes' => '',
'text' => $text
);
}

}

0 comments on commit 57ee306

Please sign in to comment.