Setting the <title> tag dynamically

I wonder how I set the title-tag from inside a page.
I am using the History-addon and Vaadin 8.1 and things are really starting to get SEO-friendly, but the title-tag is kept to my initial value and doesn’t change when the user is moving around the site

Would Page.setTitle() resolve your issue?

I was trying that method, but it only sets the title of the tab and not the actual tag. Unfortunately google search engine dont care about the tab-name :stuck_out_tongue:

How about a BootstrapListener, then - see e.g. this
mini-tutorial
(for Vaadin 7, but should not have changed much in 8.1) on how to use it to customize the startup page that is created by the server.

That one only changes the initial tag if I understand it correctly, not when surfing around on the site.

I did:
JavaScript.getCurrent.execute(s""“document.title = “$title”; “””)
And that doesn’t change the actual title-tag in the document either. So it migh be that I just need to hope for google to catch title changes made by Page.setTitle(). So back to how it was from the beginning and just hope for the best :slight_smile:

Thanks for your help Henri!

At least according to this http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157 changing document.title could be enough.

-Olli