commit a40c582eb791f9f13cc689de403930533cfb2a8d Author: rdrew Date: Mon May 13 11:58:58 2024 -0300 1st diff --git a/css/library-fundraiser.css b/css/library-fundraiser.css new file mode 100644 index 0000000..e29d3e0 --- /dev/null +++ b/css/library-fundraiser.css @@ -0,0 +1,5 @@ + +/* Add your custom CSS styles here */ +.library-fundraiser-block { + /* Define your styles */ +} diff --git a/library_fundraiser.info.yml b/library_fundraiser.info.yml new file mode 100644 index 0000000..b6e01c5 --- /dev/null +++ b/library_fundraiser.info.yml @@ -0,0 +1,13 @@ +name: 'Library Fundraiser' +type: module +description: 'Creates a custom block for library fundraising purposes.' +core_version_requirement: ^10 +package: Custom +dependencies: + - block + +libraries: + - library_fundraiser/library-fundraiser-styles: + css: + theme: + css/library-fundraiser.css: {} diff --git a/library_fundraiser.libraries.yml b/library_fundraiser.libraries.yml new file mode 100644 index 0000000..e69de29 diff --git a/library_fundraiser.module b/library_fundraiser.module new file mode 100644 index 0000000..e69de29 diff --git a/src/Plugin/Block/LibraryFundraiserBlock.php b/src/Plugin/Block/LibraryFundraiserBlock.php new file mode 100644 index 0000000..bb7e7a3 --- /dev/null +++ b/src/Plugin/Block/LibraryFundraiserBlock.php @@ -0,0 +1,42 @@ + + .libfund_block { + background: green; + } + +
+

It works

+
'; + $build = [ + '#theme' => 'library_fundraiser_block', + '#markup' => \Drupal\Core\Render\Markup::create($html), + ]; + + // Attach the library. + $build['#attached']['library'][] = 'library_fundraiser/library-fundraiser-styles'; + + return $build; + } + +} diff --git a/templates/block--libraryfundraiserblock.html.twig b/templates/block--libraryfundraiserblock.html.twig new file mode 100644 index 0000000..9413e07 --- /dev/null +++ b/templates/block--libraryfundraiserblock.html.twig @@ -0,0 +1,4 @@ + +
+ {{ content }} +
diff --git a/templates/library-fundraiser-block.html.twig b/templates/library-fundraiser-block.html.twig new file mode 100644 index 0000000..9413e07 --- /dev/null +++ b/templates/library-fundraiser-block.html.twig @@ -0,0 +1,4 @@ + +
+ {{ content }} +