change html <title> only?

On a custom page, is there a native way to change only the html title of a custom resource page? I dont want to affect any breadcrumbs or nav.
Solution:
like this protected static ?string $title = 'custom title';
Jump to solution
19 Replies
Mark Chaney
Mark ChaneyOP11mo ago
nvm, would be good to know, but solved my issue with document.title with javascript. Just needed it for printing purposes.
Vp
Vp11mo ago
Maybe like this protected static ?string $title = 'title';
Mark Chaney
Mark ChaneyOP11mo ago
@Vp that would change the title everywhere, not just the html <title> attribute
Vp
Vp11mo ago
wdym everywhere? I create a page using make:filament-page and I put this $title and html <title> contain my $title data I also put this protected ?string $heading = ''; because I don't want the heading to display
Dennis Koch
Dennis Koch11mo ago
He said he want the <title> Tag to change only. Not the displayed title on the page. So does different $title and $heading property works in this case?
Vp
Vp11mo ago
I think so, I used like above and this is what I get.. notice "custom title" in tab
No description
Vp
Vp11mo ago
If they don't want "custom title" in tab, then my answer were wrong 😆
matin rajabi
matin rajabi8mo ago
how did you put that custom title?
Solution
Vp
Vp8mo ago
like this protected static ?string $title = 'custom title';
matin rajabi
matin rajabi8mo ago
look here is my code:
No description
matin rajabi
matin rajabi8mo ago
but this is my title :
No description
Vp
Vp8mo ago
Is this resource? because the previous one is for custom page
matin rajabi
matin rajabi8mo ago
yes this is a resource created by filament command
Vp
Vp8mo ago
I am not sure about resource, sorry
Dennis Koch
Dennis Koch8mo ago
Put it on the pages then.
Vp
Vp8mo ago
That "Laravel" is your app_name from .env file right?
matin rajabi
matin rajabi8mo ago
thanks dear dennis🤝 yeah that's right
Vp
Vp8mo ago
so, problem solves?
matin rajabi
matin rajabi8mo ago
yes thank you 🤝 😃
Want results from more Discord servers?
Add your server