Open amoeba opened 3 years ago
Sounds like a great idea to me. I think we could put a hook for this into the AppView, since it knows when a new view has been rendered. Then each view will have a function for constructing a title string. We have to wait for asynchronous requests, like to Solr to get the citation metadata, so each view will handle the title construction a bit differently.
I would vote for option 2!
@BrennieDev just brought this up on Slack and Erin McLean also noted she had gotten this feedback in focus groups:
When you visit a dataset landing page (ie
/view/:pid
), the document title doesn't change to reflect anything unique about the page, such as the title or citation string for the dataset.Updating page titles dynamically to match the content has at least two advantages:
As an exmple: https://arcticdata.io/catalog/view/doi%3A10.18739%2FA27H1DN5S has the title "Arctic Data Center", when it could have a title such as:
(Votes for the above or offers of other ideas welcomed)
Places we could update the title dynamically might include:
As for implementation, I see two routes forward:
document.title = 'foo'
changes throughout the codebase, remembering to reset it on navigation appropriately every time@laurenwalker @csjx any thoughts on this? Anyone else's thoughts also welcome, esp wrt the title formats above.