diff --git a/source/_posts/2015-04-03-minimum-core-version.md b/source/_posts/2015-04-03-minimum-core-version.md index b8b2608b..0b5efbdd 100644 --- a/source/_posts/2015-04-03-minimum-core-version.md +++ b/source/_posts/2015-04-03-minimum-core-version.md @@ -8,6 +8,11 @@ tags: - Drupal - Drupal 7 - Drupal Planet +meta: + og: + title: 'How to Define a Minimum Drupal Core Version' + description: 'How to define a minimum Drupal core version for your module or theme.' + type: article --- This week, my first code patch was [committed to Drupal core](https://www.drupal.org/node/2394517#comment-9773143). The patch adds the `user_has_role()` function to theu user module, to simplify the way to check whether a user in Drupal has been assigned a specific role. This is something that I normally write a custom function for each project, but it's now available in Drupal core as of [7.36](https://www.drupal.org/drupal-7.36-release-notes). diff --git a/source/themes/opdavies/opdavies/_layouts/default.html.twig b/source/themes/opdavies/opdavies/_layouts/default.html.twig index 4d687280..421c5688 100644 --- a/source/themes/opdavies/opdavies/_layouts/default.html.twig +++ b/source/themes/opdavies/opdavies/_layouts/default.html.twig @@ -7,6 +7,7 @@ {% if page.meta.description %} {% endif %} + {% if page.meta.og %}{% include "og" with {og: page.meta.og} %}{% endif %} {% if (page.front == true) and (site.subtitle) %}{{ site.subtitle }}{% else %}{{ page.title }}{% endif %} | {{ site.title }} diff --git a/source/themes/opdavies/opdavies/_partials/og.html.twig b/source/themes/opdavies/opdavies/_partials/og.html.twig new file mode 100644 index 00000000..f9e81e60 --- /dev/null +++ b/source/themes/opdavies/opdavies/_partials/og.html.twig @@ -0,0 +1,37 @@ +{% if og.title %} + +{% endif %} + +{% if og.description %} + +{% endif %} + +{% if og.type %} + +{% endif %} + +{% if og.image and og.image.url %} + + {% if og.image.type %} + + {% endif %} + {% if og.image.width %} + + {% endif %} + {% if og.image.height %} + + {% endif %} +{% endif %} + +{% if og.title %} + {% if og.image %} + + + + {% else %} + + {% endif %} + + + +{% endif %} \ No newline at end of file