{"id":13852394,"url":"https://github.com/BurdaPraha/DrupalTwigFood","last_synced_at":"2025-07-13T05:32:55.428Z","repository":{"id":62498263,"uuid":"79471728","full_name":"BurdaPraha/DrupalTwigFood","owner":"BurdaPraha","description":"Useful functions, filters for twig @ Drupal 8","archived":false,"fork":false,"pushed_at":"2022-02-20T17:51:33.000Z","size":30,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-01T04:50:05.574Z","etag":null,"topics":["czech-republic","drupal","drupal-8","filter","prague","region","svg","twig","twig-extension"],"latest_commit_sha":null,"homepage":"http://www.burda.cz","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BurdaPraha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-19T16:25:10.000Z","updated_at":"2022-03-16T14:36:43.000Z","dependencies_parsed_at":"2022-11-02T11:46:50.762Z","dependency_job_id":null,"html_url":"https://github.com/BurdaPraha/DrupalTwigFood","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/BurdaPraha/DrupalTwigFood","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurdaPraha%2FDrupalTwigFood","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurdaPraha%2FDrupalTwigFood/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurdaPraha%2FDrupalTwigFood/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurdaPraha%2FDrupalTwigFood/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BurdaPraha","download_url":"https://codeload.github.com/BurdaPraha/DrupalTwigFood/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BurdaPraha%2FDrupalTwigFood/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265094962,"owners_count":23710575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["czech-republic","drupal","drupal-8","filter","prague","region","svg","twig","twig-extension"],"created_at":"2024-08-04T22:01:18.509Z","updated_at":"2025-07-13T05:32:55.186Z","avatar_url":"https://github.com/BurdaPraha.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# DrupalTwigFood\nUseful functions, filters for twig @ Drupal 8\n\n## Instalation\nRecomended using is via Composer:\n`composer require burdapraha/drupal_twig_food`\n... and install module \"Burda Twig Food\" in administration (domain.tld/admin/modules)\n\n## Documentation\n\nThe best documentation is easy examples, right? :-)\n\n### Functions\n\n#### - svg($path)\noffering comfortably using svg images in templates, example: ```{{ svg('awesome_icon.svg') }}``` when file is stored in \"/your-theme-name/images/awesome_icon.svg\" and source code of svg will be printed to page as is. This solution is quick and you can use CSS features like \".your-div svg {fill: red}\" etc.\n\n#### - load_block($id)\nyou can call block by name anywhere in template: ```{{ load_block('machine_name') }}```\n\n#### - load_region($id)\nthis function offers print all block of the region anywhere you need: ```{{ load_region('machine_name') }}```\n\n#### - load_main_node($returnId = true)\nsolving problem with getting node id from anywhere template when you need it ```{{ load_main_node() }}```\n\n#### - load_gallery_prev($currentGalleryId, $thumbnailStyle = 'thumbnail')\narray with previous media gallery: ```{{ load_gallery_prev(2) }}```\n\n#### - load_gallery_next($currentGalleryId, $thumbnailStyle = 'thumbnail')\narray with next media media: ```{{ load_gallery_next(1) }}```\n\n#### - load_gallery_thumbs($galleryId, $thumbnailStyle = 'thumbnail')\narray with images from gallery: ```{{ load_gallery_thumbs(5) }}```\n\n------\n\n### Filters\n\n#### - naked_field\nreturn rendered field, for example from view, without developers suggestions (```\u003c!-- Hook: etc ---\u003e```), without HTML tags like `\u003ca href=\"xy\"\u003eyour_filed\u003c/a\u003e`. Just naked string what you can use as class, data attribute or in twig condition! Using example: `{% set badge = content.field_show_badge|naked_field %}`\n\n#### - max_length($max = 0, $dots = true)\nCheck string length and return him summary or in original. It is pretty alternative to ugly ```{{ teaser_text|length \u003e 90 ? teaser_text|slice(0, 90) ~ ' ...' : teaser_text }}```. By second parameter you can disable adding \"...\" to the end of string.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBurdaPraha%2FDrupalTwigFood","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBurdaPraha%2FDrupalTwigFood","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBurdaPraha%2FDrupalTwigFood/lists"}