What's the purpose of @page_title
in the title tag?
#36
-
I'm curious what the Setting |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The
You are correct that the client-side also needs to know what the page title should be, so that it can be kept up to date any time the page changes (and for internal navigation, this needs to happen using just the information provided via Inertia page props). It could be interesting to think about making this more "automatic", but I'm hesitant to add too much magic. This is how I've been solving this in my apps:
|
Beta Was this translation helpful? Give feedback.
The
<.inertia_title>
server-side component (which is populated with thepage_title
assign variable by convention) is a simple component that:inertia
attribute on the title tag (<title inertia>Your Title</title>
), so that the client-side can change the title as it needs to (via the<Head>
component).You are correct that the client-side also needs to know what the page title should be, so that it can be kept up to date any time the page changes (and for internal navigation, this needs to happen using just the information provided via Inertia page …