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.
I'm using the following tokens to generate an automatic node title:
[node:menu-link:parent:title]: [node:title] | [site:name]
But when [node:menu-link:parent:title] is empty the title will start with the colon separator (:). Is there a way to combine the separator with the token, so it's hidden when the token is empty?
Or where (template.php, custom module) can I alter the generated title to trim separator characters from the beginning of the title (and other meta tags)?
Comments
Comment #1
DamienMcKennaYou'd have to implement hook_metatag_metatags_view_alter() to and use str_replace() to remove the unwanted string.