Remove the hard-coded footer and menu links
This commit is contained in:
parent
98472ea66b
commit
58869fa91e
6 changed files with 98 additions and 40 deletions
25
config/sync/block.block.opdavies_mainnavigation.yml
Normal file
25
config/sync/block.block.opdavies_mainnavigation.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
uuid: 99c8b757-57b6-4c44-81ac-46063b0bacac
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
config:
|
||||||
|
- system.menu.main
|
||||||
|
module:
|
||||||
|
- system
|
||||||
|
theme:
|
||||||
|
- opdavies
|
||||||
|
id: opdavies_mainnavigation
|
||||||
|
theme: opdavies
|
||||||
|
region: footer
|
||||||
|
weight: 0
|
||||||
|
provider: null
|
||||||
|
plugin: 'system_menu_block:main'
|
||||||
|
settings:
|
||||||
|
id: 'system_menu_block:main'
|
||||||
|
label: 'Main navigation'
|
||||||
|
label_display: '0'
|
||||||
|
provider: system
|
||||||
|
level: 1
|
||||||
|
depth: 0
|
||||||
|
expand_all_items: false
|
||||||
|
visibility: { }
|
|
@ -7,3 +7,9 @@ definitions:
|
||||||
weight: 0
|
weight: 0
|
||||||
expanded: false
|
expanded: false
|
||||||
enabled: true
|
enabled: true
|
||||||
|
standard__front_page:
|
||||||
|
weight: -50
|
||||||
|
menu_name: main
|
||||||
|
parent: ''
|
||||||
|
enabled: true
|
||||||
|
expanded: false
|
||||||
|
|
|
@ -2,9 +2,9 @@ _core:
|
||||||
default_config_hash: jtno5biznHZbrIgKwzq-ze-7XaQxLCGe6PeUOR7bRiQ
|
default_config_hash: jtno5biznHZbrIgKwzq-ze-7XaQxLCGe6PeUOR7bRiQ
|
||||||
cache:
|
cache:
|
||||||
page:
|
page:
|
||||||
max_age: 0
|
max_age: 3600
|
||||||
css:
|
css:
|
||||||
preprocess: false
|
preprocess: true
|
||||||
gzip: true
|
gzip: true
|
||||||
fast_404:
|
fast_404:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@ -12,5 +12,5 @@ fast_404:
|
||||||
exclude_paths: '/\/(?:styles|imagecache)\//'
|
exclude_paths: '/\/(?:styles|imagecache)\//'
|
||||||
html: '<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>'
|
html: '<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>'
|
||||||
js:
|
js:
|
||||||
preprocess: false
|
preprocess: true
|
||||||
gzip: true
|
gzip: true
|
||||||
|
|
|
@ -31,7 +31,11 @@
|
||||||
"value": "Contact"
|
"value": "Contact"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": [],
|
"description": [
|
||||||
|
{
|
||||||
|
"value": "Email Oliver"
|
||||||
|
}
|
||||||
|
],
|
||||||
"menu_name": [
|
"menu_name": [
|
||||||
{
|
{
|
||||||
"value": "main"
|
"value": "main"
|
||||||
|
@ -67,7 +71,7 @@
|
||||||
"parent": [],
|
"parent": [],
|
||||||
"changed": [
|
"changed": [
|
||||||
{
|
{
|
||||||
"value": "2025-04-16T18:24:30+00:00"
|
"value": "2025-05-11T14:44:00+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"default_langcode": [
|
"default_langcode": [
|
||||||
|
|
49
web/themes/custom/opdavies/templates/menu--main.html.twig
Normal file
49
web/themes/custom/opdavies/templates/menu--main.html.twig
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{#
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Default theme implementation to display a menu.
|
||||||
|
*
|
||||||
|
* Available variables:
|
||||||
|
* - menu_name: The machine name of the menu.
|
||||||
|
* - items: A nested list of menu items. Each menu item contains:
|
||||||
|
* - attributes: HTML attributes for the menu item.
|
||||||
|
* - below: The menu item child items.
|
||||||
|
* - title: The menu link title.
|
||||||
|
* - url: The menu link URL, instance of \Drupal\Core\Url
|
||||||
|
* - localized_options: Menu link localized options.
|
||||||
|
* - is_expanded: TRUE if the link has visible children within the current
|
||||||
|
* menu tree.
|
||||||
|
* - is_collapsed: TRUE if the link has children within the current menu tree
|
||||||
|
* that are not currently visible.
|
||||||
|
* - in_active_trail: TRUE if the link is in the active trail.
|
||||||
|
*
|
||||||
|
* @ingroup themeable
|
||||||
|
*/
|
||||||
|
#}
|
||||||
|
{% import _self as menus %}
|
||||||
|
|
||||||
|
{{ menus.menu_links(items, attributes, 0) }}
|
||||||
|
|
||||||
|
{% macro menu_links(items, attributes, menu_level) %}
|
||||||
|
{% import _self as menus %}
|
||||||
|
{% if items %}
|
||||||
|
{% if menu_level == 0 %}
|
||||||
|
<ul{{ attributes.addClass('flex flex-wrap justify-center -mb-3') }}>
|
||||||
|
{% else %}
|
||||||
|
<ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% for item in items %}
|
||||||
|
<li{{ item.attributes }}>
|
||||||
|
{{ link(item.title, item.url, {
|
||||||
|
class: 'mx-3 mb-3 text-base block underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900',
|
||||||
|
}) }}
|
||||||
|
|
||||||
|
{% if item.below %}
|
||||||
|
{{ menus.menu_links(item.below, attributes, menu_level + 1) }}
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
|
@ -97,12 +97,6 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
{% if page.footer %}
|
|
||||||
<footer role="contentinfo">
|
|
||||||
{{ page.footer }}
|
|
||||||
</footer>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h2 class="text-xl font-bold">About me</h2>
|
<h2 class="text-xl font-bold">About me</h2>
|
||||||
|
|
||||||
|
@ -120,34 +114,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer class="mt-16 mb-6">
|
{% if page.footer %}
|
||||||
|
<div class="mt-16 mb-6">
|
||||||
<a id="footer" tabindex="-1"></a>
|
<a id="footer" tabindex="-1"></a>
|
||||||
<nav class="flex flex-wrap justify-center -mb-3">
|
|
||||||
<a class="mx-3 mb-3 text-base underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900" href="/" title="Home">
|
<footer>
|
||||||
Home
|
{{ page.footer }}
|
||||||
</a>
|
|
||||||
<a class="mx-3 mb-3 text-base underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900" href="/press" title="Press Info">
|
|
||||||
Press Info
|
|
||||||
</a>
|
|
||||||
<a class="mx-3 mb-3 text-base underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900" href="/pricing" title="Services">
|
|
||||||
Services
|
|
||||||
</a>
|
|
||||||
<a class="mx-3 mb-3 text-base underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900" href="/presentations" title="Presentations">
|
|
||||||
Presentations
|
|
||||||
</a>
|
|
||||||
<a class="mx-3 mb-3 text-base underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900" href="/podcast" title="The Beyond Blocks Podcast">
|
|
||||||
Podcast
|
|
||||||
</a>
|
|
||||||
<a class="mx-3 mb-3 text-base underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900" href="/daily" title="The Daily Drupaler Email List">
|
|
||||||
Daily list
|
|
||||||
</a>
|
|
||||||
<a class="mx-3 mb-3 text-base underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900" href="/sponsor" title="Sponsor me">
|
|
||||||
Sponsor me
|
|
||||||
</a>
|
|
||||||
<a class="mx-3 mb-3 text-base underline md:text-lg dark:text-white hover:no-underline link dark:hover:text-blue-400 hover:text-gray-900" href="mailto:oliver+website@oliverdavies.uk" title="Contact Oliver">
|
|
||||||
Contact
|
|
||||||
</a>
|
|
||||||
</nav>
|
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue