Problem/Motivation

I am trying to replace some symbols (namely HTML markup - for example <br> or <sup>) that I use in page titles and should not be present int he HEAD TITLE.
I created a custom module implementing hook_page_title_alter(&$title) to replace a <br> tag in the slogan with a dash symbol in the front page title.

However, my function (or any function implementing the hook for that matter) gets called only if I call page_title_get_title() from the template.php in the template_preprocess_html(&$variables).

Proposed resolution

The fact that no other hooks get called lead me to think that it is a documentation/usage issue rather than a bug. Unfortunately I have no time to read the source code carefully to figure out which is which at the moment. I found a workaround for my case, but I am concerned it might eventually break if this in fact is a bug and gets fixed in the future.
Can you provide a short description (use case scenario) on how to use the hook(s)?

Remaining tasks

User interface changes

API changes

Comments

DYdave’s picture

Status: Active » Needs review

Hi luchoh,

Thanks very much for sharing your concerns and posting this issue.

I also had quite a hard time trying to figure out how to work with Page Title API hooks and it looks like we wouldn't be the only ones.
I just wanted to let you know I have started working on putting together an API documentation file at #1872638: Document Page Title API hooks and would like to know if you could potentially also try to give your feedback in that ticket, in particular if the description comments for the hook_page_title_alter could be or have been of any help to you while working on its implementation.

I would greatly appreciate some help reviewing and if you could perhaps take a bit of time to look into the suggested patch to give me your feedback/opinion on this initial documentation draft.

Please let me know if you would have any questions on any points/code/aspects mentioned in this comment or documentation patch, I would surely be glad to provide more information.

Any feedback, testing, changes, recommendations, help or questions would be highly appreciated.
Thanks to all in advance.