I have a block where I want to include a token of the current page Title. But it's either caching or locking up after the first page.

In a sidebar there's a block where I've tried two things:
1. "Find out more about [current-page:title]..." 2. "Find out more about [node:title]..."

[node:title] gives nothing - a blank result.

[current-page:title] will often give the first page a visitor sees. But when they navigate to another page, it only remembers the previous page. They visit page#2 and the text still says "Find out more about page#1"

I don't even know where to begin on this. I have enabled Tokens, as well as Custom tokens and Pathauto. I don't think those would cause any issues, but I mention just in case.

I can research and modify this question if someone has an idea what steps I might take to refine to something more specific

| improve this question | | | | |
  • What block? A custom block created from the UI, or provided from a custom module? This block simply seems to be cached too hard when it must be cached per URL. – leymannx Oct 9 '19 at 22:26
  • 1
    I agree with @leymannx, sounds like this block lacks cache context. Regular UI blocks are not meant to be used dynamically like this. I suggest you create View bock instead with contextual filter of entity id, this is the proper approach. – No Sssweat Oct 10 '19 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.