Adjusting thigns to go to queue.

This commit is contained in:
calcu1on
2025-03-30 22:59:13 -04:00
parent c49263a78d
commit 18cb2c1a8b
9 changed files with 204 additions and 22 deletions

View File

@@ -25,3 +25,12 @@ function dc_core_taxo_form_submit($form, &$form_state) {
}
function dc_core_theme() {
return [
'lotr_characters' => [
'variables' => [
'characters' => [],
],
],
];
}

View File

@@ -411,7 +411,23 @@ trait LotrCharacterList {
'bio' => 'Gothmog was the Lieutenant of Morgul and a high-ranking commander of Saurons forces in the War of the Ring. As one of the more prominent Orc leaders, he was present during the Battle of the Pelennor Fields, leading the forces of Mordor. Gothmogs grotesque appearance and ruthlessness made him a terrifying figure. He met his end in the Battle of the Black Gate, where his forces were destroyed and he himself was slain by the armies of Gondor and Rohan.',
'image_url' => 'https://vignette.wikia.nocookie.net/lotr/images/9/94/Gothmog_Lieutenant_of_Morgul.png/revision/latest/scale-to-width-down/350?cb=20190602142219',
'youtube_url' => 'https://www.youtube.com/watch?v=hegeHfK5Dh4'
]
],
[
'name' => 'Dan Chadwick',
'species' => 'Human',
'height' => 'Huge',
'hair' => 'Brown',
'eyes' => 'Blue',
'birth' => 'Unknown',
'death' => 'Unknown, last seen leaving Middle-earth',
'title' => 'Drupalist',
'occupation' => 'Strugglbus',
'affiliation' => 'Twilight new moon',
'bio' => 'I am not sure what to put here.',
'image_url' => 'https://platform.polygon.com/wp-content/uploads/sites/2/chorus/uploads/chorus_asset/file/22263166/lotr3_movie_screencaps.com_10384.jpg',
'youtube_url' => ''
],
];
return $characters;

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace Drupal\dc_core\Plugin\Block;
use Drupal\Core\Block\Attribute\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\StringTranslation\TranslatableMarkup;
#[Block(
id: "characters_block",
admin_label: new TranslatableMarkup("LOTR Characters"),
category: new TranslatableMarkup("DC Core")
)]
final class CharactersBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build(): array {
$path = 'public://api-responses/characters.json';
$characters = json_decode(file_get_contents($path), TRUE);
$build = [
'#theme' => 'lotr_characters',
'#characters' => $characters,
];
return $build;
}
}

View File

@@ -0,0 +1,5 @@
{% for character in characters %}
<h2>{{ character.name }}</h2>
<h4>{{ character.title }}</h4>
<p>{{ character.bio }}</p>
{% endfor %}