0

I am customizing the appearance of the forums.

I added all my forums and container. Additionally, I added a custom taxonomy field I need to show for each forum category.

screenshot

How can I show the custom taxonomy field in forum-list.html.twig?

I know how to show content fields from nodes in node.html.twig, but how do I show custom taxonomy fields in forum-list.html.twig?

1 Answer 1

0

Your question is very vague.

I suggest setting up xdebug (https://www.drupal.org/docs/develop/development-tools/xdebug-debugger) then using the function devel_breakpoint() to be able to see how to reach the values/fields of your entity.

If your taxonomy is attached to your topic, I'm assuming that the solution will be something like forum.taxonomy_field.value.

If your taxonomy is not attached to your topic, you should have a look to preprocess your topic to add the missing data by using template_preprocess_forum_list() I guess?

Here is the list of all preprocess hook, maybe another one with forum might do the trick: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21theme.api.php/function/implementations/hook_preprocess_HOOK/8.2.x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.