From 0ba69d7c5a69b600918f49aecfbafe0150feb02c Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Wed, 29 Oct 2014 09:26:39 +0000 Subject: [PATCH] Issue #2349765 by derheap | davidhernandez: Copy taxonomy templates to Classy. --- .../templates/taxonomy-term.html.twig | 17 ++------ core/themes/classy/taxonomy-term.html.twig | 43 +++++++++++++++++++ 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 core/themes/classy/taxonomy-term.html.twig diff --git a/core/modules/taxonomy/templates/taxonomy-term.html.twig b/core/modules/taxonomy/templates/taxonomy-term.html.twig index 76fc81cbf34..750fd734faf 100644 --- a/core/modules/taxonomy/templates/taxonomy-term.html.twig +++ b/core/modules/taxonomy/templates/taxonomy-term.html.twig @@ -13,12 +13,7 @@ * @code * {{ content|without('description') }} * @endcode - * - attributes: HTML attributes for the wrapper. The 'class' attribute - * contains the following classes by default: - * - taxonomy-term: The current template type, i.e. "theming hook". - * - vocabulary-[vocabulary-name]: The vocabulary that this term belongs to. - * For example, if the term belongs to a vocabulary called "Tags" then the - * class would be "vocabulary-tags". + * - attributes: HTML attributes for the wrapper. * - page: Flag for the full page state. * - term: The taxonomy term entity, including: * - id: The ID of the taxonomy term. @@ -30,19 +25,13 @@ * @ingroup themeable */ #} -{% - set classes = [ - 'taxonomy-term', - 'vocabulary-' ~ term.bundle|clean_class, - ] -%} -
+ {{ title_prefix }} {% if not page %}

{{ name }}

{% endif %} {{ title_suffix }} -
+
{{ content }}
diff --git a/core/themes/classy/taxonomy-term.html.twig b/core/themes/classy/taxonomy-term.html.twig new file mode 100644 index 00000000000..2fbffa58c5e --- /dev/null +++ b/core/themes/classy/taxonomy-term.html.twig @@ -0,0 +1,43 @@ +{# +/** + * @file + * Default theme implementation to display a taxonomy term. + * + * Available variables: + * - url: URL of the current term. + * - name: Name of the current term. + * - content: Items for the content of the term (fields and description). + * Use 'content' to print them all, or print a subset such as + * 'content.description'. Use the following code to exclude the + * printing of a given child element: + * @code + * {{ content|without('description') }} + * @endcode + * - attributes: HTML attributes for the wrapper. + * - page: Flag for the full page state. + * - term: The taxonomy term entity, including: + * - id: The ID of the taxonomy term. + * - bundle: Machine name of the current vocabulary. + * - view_mode: View mode, e.g. 'full', 'teaser', etc. + * + * @see template_preprocess_taxonomy_term() + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'taxonomy-term', + 'vocabulary-' ~ term.bundle|clean_class, + ] +%} +
+ {{ title_prefix }} + {% if not page %} +

{{ name }}

+ {% endif %} + {{ title_suffix }} +
+ {{ content }} +
+