Ensure a proper heading structure
Replace h2s with h3s so that they are not at the same level as the h2s for the post titles.
This commit is contained in:
parent
73a0931377
commit
167617dc0c
|
@ -11,13 +11,6 @@ meta:
|
|||
description: 'How to define a minimum Drupal core version for your module or theme.'
|
||||
type: article
|
||||
---
|
||||
{% block excerpt %}
|
||||
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 the 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).
|
||||
|
||||
But what if someone is using a core version less than 7.36 and tries using the function? The site would return an error because that function wouldn't exist.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
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 the 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).
|
||||
|
||||
But what if someone is using a core version less than 7.36 and tries using the function? The site would return an error because that function wouldn't exist.
|
||||
|
@ -67,4 +60,3 @@ Because we need to check for Drupal's core version, we're using the system modul
|
|||
## External Links
|
||||
|
||||
* [Writing module .info files (Drupal 7.x)](https://www.drupal.org/node/542202#dependencies)
|
||||
{% endblock %}
|
||||
|
|
|
@ -19,7 +19,7 @@ use:
|
|||
{% if post.blocks.excerpt %}
|
||||
{{ post.blocks.excerpt|raw }}
|
||||
{% else %}
|
||||
<p>{{ post.blocks.content|raw|split(' ')|slice(0,50)|join(' ')|raw }} …</p>
|
||||
<p>{{ post.blocks.content|raw|split(' ')|slice(0,50)|join(' ')|replace({ 'h2':'h3' })|raw }} …</p>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ post.url }}">Read more →</a>
|
||||
|
|
Reference in a new issue