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

Vote-418: Homepage Scaffolding #445

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions web/themes/custom/votegov/php-includes/page.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/**
* @file
* Preprocess function for page.
*/

/**
* Implements hook_theme_suggestion_HOOK_alter().
*/
function votegov_theme_suggestions_page_alter(array &$suggestions, array $variables) {
if ($node = \Drupal::routeMatch()->getParameter('node')) {
$suggestions[] = "page__node__" . $node->bundle();
}
}
rayestrada marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@
</div>
</section>
{% endblock %}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends "page.html.twig" %}

{% block main %}
{# admin region. #}
{{ page.admin }}

{# Main content region. #}
{{ page.content }}
{% endblock %}
5 changes: 4 additions & 1 deletion web/themes/custom/votegov/templates/layout/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,18 @@
</div>
</header>

<main role="main" class="main-content clearfix grid-container">
<main role="main" class="main-content">
{# link is in html.html.twig #}
<a id="main-content" tabindex="-1"></a>

{% block main %}
<div class="layout-content grid-container-widescreen">
{# admin region. #}
{{ page.admin }}
</div>

<div class="layout-content grid-container-widescreen">

{# Main content region. #}
<div class="grid-row grid-gap-lg">
<div class="desktop:grid-col-9 order-last">
Expand All @@ -88,6 +90,7 @@
{% endif %}
</div>
</div>{# /.layout-content #}
{% endblock %}
</main>

<footer class="usa-footer usa-footer--big">
Expand Down
1 change: 1 addition & 0 deletions web/themes/custom/votegov/votegov.theme
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
require_once dirname(__FILE__) . '/php-includes/block.inc';
require_once dirname(__FILE__) . '/php-includes/navigation.inc';
require_once dirname(__FILE__) . '/php-includes/preprocess.inc';
require_once dirname(__FILE__) . '/php-includes/page.inc';