diff --git a/config/sync/core.entity_view_display.block_content.about_me.default.yml b/config/sync/core.entity_view_display.block_content.about_me.default.yml index 1b94a9a..dffc4ab 100644 --- a/config/sync/core.entity_view_display.block_content.about_me.default.yml +++ b/config/sync/core.entity_view_display.block_content.about_me.default.yml @@ -6,9 +6,15 @@ dependencies: - block_content.type.about_me - field.field.block_content.about_me.body - field.field.block_content.about_me.field_image + - image.style.thumbnail module: - image + - layout_builder - text +third_party_settings: + layout_builder: + enabled: false + allow_custom: false id: block_content.about_me.default targetEntityType: block_content bundle: about_me @@ -26,7 +32,7 @@ content: label: hidden settings: image_link: '' - image_style: '' + image_style: thumbnail image_loading: attribute: lazy third_party_settings: { } diff --git a/config/sync/core.entity_view_display.node.testimonial.default.yml b/config/sync/core.entity_view_display.node.testimonial.default.yml index 26d9247..8940ca0 100644 --- a/config/sync/core.entity_view_display.node.testimonial.default.yml +++ b/config/sync/core.entity_view_display.node.testimonial.default.yml @@ -7,7 +7,7 @@ dependencies: - field.field.node.testimonial.field_image - field.field.node.testimonial.field_link - field.field.node.testimonial.field_tagline - - image.style.wide + - image.style.testimonial - node.type.testimonial module: - image @@ -24,14 +24,14 @@ content: label: hidden settings: { } third_party_settings: { } - weight: 1 + weight: 0 region: content field_image: type: image label: hidden settings: image_link: '' - image_style: wide + image_style: testimonial image_loading: attribute: eager third_party_settings: { } @@ -55,7 +55,7 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 0 + weight: 1 region: content links: settings: { } diff --git a/config/sync/image.style.testimonial.yml b/config/sync/image.style.testimonial.yml new file mode 100644 index 0000000..18eb8cd --- /dev/null +++ b/config/sync/image.style.testimonial.yml @@ -0,0 +1,15 @@ +uuid: 84ebe8ae-635f-4471-a2bd-f41cfb90f932 +langcode: en +status: true +dependencies: { } +name: testimonial +label: 'Testimonial image' +effects: + 20465a93-a7e6-48b4-90e3-ac74fa68ca29: + uuid: 20465a93-a7e6-48b4-90e3-ac74fa68ca29 + id: image_scale_and_crop + weight: 1 + data: + width: 100 + height: 100 + anchor: center-center diff --git a/web/themes/custom/opdavies/opdavies.theme b/web/themes/custom/opdavies/opdavies.theme new file mode 100644 index 0000000..3524c2a --- /dev/null +++ b/web/themes/custom/opdavies/opdavies.theme @@ -0,0 +1,14 @@ + + {{ title_prefix }} + {% if label %} + {{ label }} + {% endif %} + {{ title_suffix }} + + {% block content %} + +
+
+
+ {{ content.field_image }} +
+ + {{ content.body }} +
+
+ {{ content|without('body')|without('field_image') }} + {% endblock %} + diff --git a/web/themes/custom/opdavies/templates/block/block.html.twig b/web/themes/custom/opdavies/templates/block/block.html.twig index 8818ad8..a863f33 100644 --- a/web/themes/custom/opdavies/templates/block/block.html.twig +++ b/web/themes/custom/opdavies/templates/block/block.html.twig @@ -29,7 +29,7 @@ {{ title_prefix }} {% if label %} - {{ label }} + {{ label }} {% endif %} {{ title_suffix }} diff --git a/web/themes/custom/opdavies/templates/content/node--testimonial.html.twig b/web/themes/custom/opdavies/templates/content/node--testimonial.html.twig new file mode 100644 index 0000000..3e16b54 --- /dev/null +++ b/web/themes/custom/opdavies/templates/content/node--testimonial.html.twig @@ -0,0 +1,98 @@ +{# +/** + * @file + * Theme override to display a node. + * + * Available variables: + * - node: The node entity with limited access to object properties and methods. + * Only method names starting with "get", "has", or "is" and a few common + * methods such as "id", "label", and "bundle" are available. For example: + * - node.getCreatedTime() will return the node creation timestamp. + * - node.hasField('field_example') returns TRUE if the node bundle includes + * field_example. (This does not indicate the presence of a value in this + * field.) + * - node.isPublished() will return whether the node is published or not. + * Calling other methods, such as node.delete(), will result in an exception. + * See \Drupal\node\Entity\Node for a full list of public properties and + * methods for the node object. + * - label: (optional) The title of the node. + * - content: All node items. Use {{ content }} to print them all, + * or print a subset such as {{ content.field_example }}. Use + * {{ content|without('field_example') }} to temporarily suppress the printing + * of a given child element. + * - author_picture: The node author user entity, rendered using the "compact" + * view mode. + * - metadata: Metadata for this node. + * - date: (optional) Themed creation date field. + * - author_name: (optional) Themed author name field. + * - url: Direct URL of the current node. + * - display_submitted: Whether submission information should be displayed. + * - attributes: HTML attributes for the containing element. + * The attributes.class element may contain one or more of the following + * classes: + * - node: The current template type (also known as a "theming hook"). + * - node--type-[type]: The current node type. For example, if the node is an + * "Article" it would result in "node--type-article". Note that the machine + * name will often be in a short form of the human readable label. + * - node--view-mode-[view_mode]: The View Mode of the node; for example, a + * teaser would result in: "node--view-mode-teaser", and + * full: "node--view-mode-full". + * The following are controlled through the node publishing options. + * - node--promoted: Appears on nodes promoted to the front page. + * - node--sticky: Appears on nodes ordered above other non-sticky nodes in + * teaser listings. + * - node--unpublished: Appears on unpublished nodes visible only to site + * admins. + * - title_attributes: Same as attributes, except applied to the main title + * tag that appears in the template. + * - content_attributes: Same as attributes, except applied to the main + * content tag that appears in the template. + * - author_attributes: Same as attributes, except applied to the author of + * the node tag that appears in the template. + * - title_prefix: Additional output populated by modules, intended to be + * displayed in front of the main title tag that appears in the template. + * - title_suffix: Additional output populated by modules, intended to be + * displayed after the main title tag that appears in the template. + * - view_mode: View mode; for example, "teaser" or "full". + * - teaser: Flag for the teaser state. Will be true if view_mode is 'teaser'. + * - page: Flag for the full page state. Will be true if view_mode is 'full'. + * - readmore: Flag for more state. Will be true if the teaser content of the + * node cannot hold the main body content. + * - logged_in: Flag for authenticated user status. Will be true when the + * current user is a logged-in member. + * - is_admin: Flag for admin user status. Will be true when the current user + * is an administrator. + * + * @see template_preprocess_node() + * + */ +#} + + {% if display_submitted %} +
+ {{ author_picture }} + + {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %} + {{ metadata }} + +
+ {% endif %} + + + {{ content.body }} + +
+ + {{ content.field_link ? link(label, content.field_link.0['#url'], create_attribute({ style: 'display: inline-block;' })) : label }} + - {{ content.field_tagline.0 }} + + + + {{ content.field_image }} + +
+ + {{ content|without('body')|without('field_image')|without('field_link')|without('field_tagline') }} + + + diff --git a/web/themes/custom/opdavies/templates/field/field--body.html.twig b/web/themes/custom/opdavies/templates/field/field--body.html.twig index 64f99ad..53dc0bb 100644 --- a/web/themes/custom/opdavies/templates/field/field--body.html.twig +++ b/web/themes/custom/opdavies/templates/field/field--body.html.twig @@ -47,17 +47,17 @@ "prose prose-p:text-black prose-a:font-light prose-a:text-blue-primary prose-p:text-lg prose-blockquote:border-blue-primary dark:marker:text-white prose-li:my-1 prose-li:text-lg prose-figcaption:text-white prose-li:text-black marker:text-black dark:prose-p:text-white dark:prose-invert dark:prose-a:text-blue-400 dark:prose-blockquote:border-blue-400 dark:prose-li:text-white hover:prose-a:no-underline prose-h2:text-xl prose-code:font-normal prose-h2:mb-4 prose-ul:my-3 dark:prose-hr:border-grey-400 prose-code:before:content-[''] prose-code:after:content-['']", ] %} -
+
{% if label_hidden %} {% if multiple %} {% for item in items %} - {{ item.content }}
+ {{ item.content }}
{% endfor %} {% else %} {% for item in items %} - {{ item.content }} + {{ item.content }} {% endfor %} {% endif %} {% else %} @@ -67,7 +67,7 @@
{% endif %} {% for item in items %} - {{ item.content }}
+ {{ item.content }} {% endfor %} {% if multiple %} diff --git a/web/themes/custom/opdavies/templates/field/field--field-recommendations.html.twig b/web/themes/custom/opdavies/templates/field/field--field-recommendations.html.twig new file mode 100644 index 0000000..4d222e0 --- /dev/null +++ b/web/themes/custom/opdavies/templates/field/field--field-recommendations.html.twig @@ -0,0 +1,61 @@ +{# +/** + * @file + * Theme override for a field. + * + * To override output, copy the "field.html.twig" from the templates directory + * to your theme's directory and customize it, just like customizing other + * Drupal templates such as page.html.twig or node.html.twig. + * + * Instead of overriding the theming for all fields, you can also just override + * theming for a subset of fields using + * @link themeable Theme hook suggestions. @endlink For example, + * here are some theme hook suggestions that can be used for a field_foo field + * on an article node type: + * - field--node--field-foo--article.html.twig + * - field--node--field-foo.html.twig + * - field--node--article.html.twig + * - field--field-foo.html.twig + * - field--text-with-summary.html.twig + * - field.html.twig + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * + * @see template_preprocess_field() + */ +#} +{% + set title_classes = [ + label_display == 'visually_hidden' ? 'visually-hidden', + ] +%} + +{% if label_hidden %} + + {% for item in items %} + {{ item.content }} + {% endfor %} + +{% else %} + + {{ label }} + +
+ {% for item in items %} + {{ item.content }}
+ {% endfor %} + + +{% endif %} diff --git a/web/themes/custom/opdavies/templates/field/field--node--field-image--testimonial.html.twig b/web/themes/custom/opdavies/templates/field/field--node--field-image--testimonial.html.twig new file mode 100644 index 0000000..2c4d102 --- /dev/null +++ b/web/themes/custom/opdavies/templates/field/field--node--field-image--testimonial.html.twig @@ -0,0 +1,56 @@ +{# +/** + * @file + * Theme override for a field. + * + * To override output, copy the "field.html.twig" from the templates directory + * to your theme's directory and customize it, just like customizing other + * Drupal templates such as page.html.twig or node.html.twig. + * + * Instead of overriding the theming for all fields, you can also just override + * theming for a subset of fields using + * @link themeable Theme hook suggestions. @endlink For example, + * here are some theme hook suggestions that can be used for a field_foo field + * on an article node type: + * - field--node--field-foo--article.html.twig + * - field--node--field-foo.html.twig + * - field--node--article.html.twig + * - field--field-foo.html.twig + * - field--text-with-summary.html.twig + * - field.html.twig + * + * Available variables: + * - attributes: HTML attributes for the containing element. + * - label_hidden: Whether to show the field label or not. + * - title_attributes: HTML attributes for the title. + * - label: The label for the field. + * - multiple: TRUE if a field can contain multiple items. + * - items: List of all the field items. Each item contains: + * - attributes: List of HTML attributes for each item. + * - content: The field item's content. + * - entity_type: The entity type to which the field belongs. + * - field_name: The name of the field. + * - field_type: The type of the field. + * - label_display: The display settings for the label. + * + * @see template_preprocess_field() + */ +#} +{% + set title_classes = [ + label_display == 'visually_hidden' ? 'visually-hidden', + ] +%} + +{% if label_hidden %} + {% for item in items %} + {{ item.content|add_class('banana') }} + {% endfor %} +{% else %} + + {{ label }} + {% for item in items %} + {{ item.content }} + {% endfor %} + +{% endif %} diff --git a/web/themes/custom/opdavies/templates/layout/html.html.twig b/web/themes/custom/opdavies/templates/layout/html.html.twig new file mode 100644 index 0000000..de8f3c7 --- /dev/null +++ b/web/themes/custom/opdavies/templates/layout/html.html.twig @@ -0,0 +1,63 @@ +{# +/** + * @file + * Theme override for the basic structure of a single Drupal page. + * + * Variables: + * - logged_in: A flag indicating if user is logged in. + * - root_path: The root path of the current page (e.g., node, admin, user). + * - node_type: The content type for the current node, if the page is a node. + * - head_title: List of text elements that make up the head_title variable. + * May contain one or more of the following: + * - title: The title of the page. + * - name: The name of the site. + * - slogan: The slogan of the site. + * - page_top: Initial rendered markup. This should be printed before 'page'. + * - page: The rendered page markup. + * - page_bottom: Closing rendered markup. This variable should be printed after + * 'page'. + * - db_offline: A flag indicating if the database is offline. + * - placeholder_token: The token for generating head, css, js and js-bottom + * placeholders. + * + * @see template_preprocess_html() + */ +#} + + + + + {{ head_title|safe_join(' | ') }} + + + + + + + + + + + + + + + + + + + + + {# + Keyboard navigation/accessibility link to main content section in + page.html.twig. + #} + + {{ 'Skip to main content'|t }} + + {{ page_top }} + {{ page }} + {{ page_bottom }} + + + diff --git a/web/themes/custom/opdavies/templates/layout/page.html.twig b/web/themes/custom/opdavies/templates/layout/page.html.twig index 9714413..5088f49 100644 --- a/web/themes/custom/opdavies/templates/layout/page.html.twig +++ b/web/themes/custom/opdavies/templates/layout/page.html.twig @@ -45,21 +45,21 @@ #}
-
-
- +
+
{{ page.highlighted }} {{ page.help }} @@ -73,11 +73,29 @@ {{ page.primary_menu }} - {% if page.footer %} -
- {{ page.footer }} -
- {% endif %} +
diff --git a/web/themes/custom/opdavies/templates/region--content.html.twig b/web/themes/custom/opdavies/templates/region--content.html.twig new file mode 100644 index 0000000..165f8da --- /dev/null +++ b/web/themes/custom/opdavies/templates/region--content.html.twig @@ -0,0 +1,19 @@ +{# +/** + * @file + * Theme override to display a region. + * + * Available variables: + * - content: The content for this region, typically blocks. + * - attributes: HTML attributes for the region
. + * - region: The name of the region variable as defined in the theme's + * .info.yml file. + * + * @see template_preprocess_region() + */ +#} +{% if content %} + + {{ content }} +
+{% endif %}