New answers tagged

1

Yes, you can force the request to have always query parameters by redirecting in an event subscriber. The problem is, how do you know what currency the user is requesting if the parameter is missing? So what you probably want is to process outbound paths to have already the correct parameters. BTW your question is a bit confusing. The first part is talking ...


1

Usually you restrict a block to a Content Type, Pages or Roles (or a mix of them) when placing the block in the block edit dialog - see https://www.drupal.org/docs/core-modules-and-themes/core-modules/block-module/managing-blocks Still, this will not handle caching for your dynamic block content. If you want to make this "switch" in your build ...


0

Any suggestion for the case when we want a block be output in different manner based on some condition? You want Cache Contexts: https://www.drupal.org/docs/drupal-apis/cache-api/cache-contexts Cache contexts provide a declarative way to create context-dependent variations of something that needs to be cached. As hudri has stated, you need a cache context ...


4

Setting cache max-age to 0 doesn't work if you still have the core module Internal Page Cache enabled. Read the documentation why you probably want to disable this module or deliver the block with a different method: Websites that serve personalized content to anonymous users (dynamic, per-session, e.g. a shopping cart) will want to disable the Internal ...


0

I don't know the caching implementation of GraphQL 3.x field plugins, but as far as I can tell this code (even after the latest update from 2018) doesn't collect the breadcrumb metadata because it only gets the links: protected function resolveValues($value, array $args, ResolveContext $context, ResolveInfo $info) { if ($value instanceof Url) { $...


Top 50 recent answers are included