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

DamienMcKenna’s picture

Issue summary: View changes
Status: Active » Fixed

You'd have to implement hook_metatag_metatags_view_alter() to and use str_replace() to remove the unwanted string.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.