Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This sounds strange, but could we please have the view title available as a field, or a token? I can explain the odd use case for this, but the answer will probably be "use hook_views_pre_render()" etc. I am trying to use that hook however the title is being overridden by panels and $view->get_title()
doesn't return the overridden title :(
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedOh hm. That doesn't sound strange actually.
Here's a question -- is there a view title token that you can use?
Comment #2
mstrelan CreditAttribution: mstrelan commentedNo. I had a look in the code, it seems it builds available tokens from fields added to the view and loops through the arguments, but that's it. I started writing a patch to add [view_title] or similar after adding the argument tokens, but that's where I ran in to my second problem, where panels overriding the title is not reflected by
$view->get_title()
.Shall I continue with the patch for a view title token, or would a global field be better, i.e. to make it more generic and reusable?