I'm currently working on a project on which I'm trying to dynamically shorten the pages titles as following:
"This is very long text blahblahblah | Site Name" becomes
"This is very ... | Site Name" but the rendered page doesn't take this into account.
Here's my problem: I tried several hooks to implement this behaviour, using
hook_node_preprocess(), etc. and I followed the indications given to update the pages titles when using these hooks, but it always falls back to using the original long title.
Actually, when I set the arrays accurate keys/values, would it be
$vars['title'], etc. I can var_dump the array and verify the needed variable is updated, but the title is untouched. Using
drupal_set_title($new_title) didn't help either.
I'm quite puzzled; would this be because I'm using Custom Field, Metatag, or a specific module? Or would this be because I'm not updating the page at the correct moment during its generation? Drupal is somehow new to me!
Thanks a lot :)