Skip to content

Commit

Permalink
Move one more block to template (relates to #11) and add price info in
Browse files Browse the repository at this point in the history
signup block.
  • Loading branch information
eiriksm committed May 10, 2015
1 parent b06b30c commit b532693
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
3 changes: 3 additions & 0 deletions drupal/modules/custom/camposlo/camposlo.module
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function camposlo_theme() {
'camposlo-contact-block' => [
'variables' => [],
],
'camposlo-register-block' => [
'variables' => ['register_link' => []],
],
];

return $theme;
Expand Down
23 changes: 11 additions & 12 deletions drupal/modules/custom/camposlo/src/Plugin/Block/SignupBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,17 @@ protected function blockAccess(AccountInterface $account) {
*/
public function build() {
return array(
'#markup' => '<div class="section" id="contact"><!-- heading -->
<div class="container">
<div class="row text-center">
<div class="section-heading">
<h2 class="title"><span>' . $this->t('Sign up!') . '</span></h2>
<p class="subtitle"><a class="btn btn-lg btn-primary" href="' . Url::fromRoute('user.register')->toString() . '">' . $this->t('Register') . '</a></p>
</div>
</div>
</div>
<!-- End heading --><!-- Contact detail -->
</div>',
'#theme' => 'camposlo-register-block',
'#register_link' => array(
'#type' => 'link',
'#url' => Url::fromRoute('user.register'),
'#title' => $this->t('Register'),
'#attributes' => [
'class' => [
'btn btn-primary btn-lg',
],
],
),
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'<div class="section" id="contact">
<div class="container">
<div class="row text-center">
<div class="section-heading">
<h2 class="title"><span>{%trans%}Sign up!{%endtrans%}</span></h2>
<p>
{%trans%}Price is either 200,- for members in the Norwegian Drupal Association or 300,- for non-members. Membership costs 200,-. You can register now and pay later.{%endtrans%}
</p>
<p class="subtitle">
{{register_link}}
</p>
</div>
</div>
</div>
</div>'

0 comments on commit b532693

Please sign in to comment.