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 Chaney5mo ago
nvm, would be good to know, but solved my issue with document.title with javascript. Just needed it for printing purposes.
Vp
Vp5mo ago
Maybe like this protected static ?string $title = 'title';
Mark Chaney
Mark Chaney5mo ago
@Vp that would change the title everywhere, not just the html <title> attribute
Vp
Vp5mo 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 Koch5mo 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
Vp5mo ago
I think so, I used like above and this is what I get.. notice "custom title" in tab
No description
Vp
Vp5mo ago
If they don't want "custom title" in tab, then my answer were wrong 😆
matin rajabi
matin rajabi2mo ago
how did you put that custom title?
Solution
Vp
Vp2mo ago
like this protected static ?string $title = 'custom title';
matin rajabi
matin rajabi2mo ago
look here is my code:
No description
matin rajabi
matin rajabi2mo ago
but this is my title :
No description
Vp
Vp2mo ago
Is this resource? because the previous one is for custom page
matin rajabi
matin rajabi2mo ago
yes this is a resource created by filament command
Vp
Vp2mo ago
I am not sure about resource, sorry
Dennis Koch
Dennis Koch2mo ago
Put it on the pages then.
Vp
Vp2mo ago
That "Laravel" is your app_name from .env file right?
matin rajabi
matin rajabi2mo ago
thanks dear dennis🤝 yeah that's right
Vp
Vp2mo ago
so, problem solves?
matin rajabi
matin rajabi2mo ago
yes thank you 🤝 😃
Want results from more Discord servers?
Add your server
More Posts