You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It happens fairly often where you want the titles across all the pages in your website to have a shared pattern.
For instance, no matter what page you're on in Stack Overflow, the title always ends with " - Stack Overflow".
It would be nice if this library provides a feature that allows users to achieve this, it would make it even more superior than it already is to Microsoft's built-in <Title> component.
I propose a property gets added to HeadElementHelperServiceOptions, so that you could do the following:
builder.Services.AddHeadElementHelper(op =>{op.TitleSuffix=" | Tesla Motors";});
Or something similar.
Without this, we currently have to repeat the suffix on every page:
(Products.razor)
<Title>Products | Tesla Motors</Title>
That way, this would suffice:
<Title>Products</Title>
Nicer, and cleaner.
There could also be a parameter for the <Title> component with which you can specify not to use the suffix, this is useful when for example you have a page whose title you want to be unique:
<TitleUseSuffix="false">Tesla Motors Home Page</Title>
The text was updated successfully, but these errors were encountered:
Of course, this proposal is very interesting.
I can implement the feature that you suggested.
But I have to consider this suggestion well to keep simplify of this library.
Unfortunately, so I have some projects those wait to fix bugs by me, I can not start to consideration or implementation about this suggestion immediately.
Don't forget that you can create your own custom Title component derived from this library, and I'll welcome it.
@jsakamoto Hi! Thanks for your response.
I get your point, and you're right, I like your demonstration of how it can be done by the developer, I also like the idea of having your custom wrapper component, so I guess I'll probably do it that way. Thank you.
Feel free to close this issue if you decide that this is better not implemented as part of the library. I understand your situation.
Have a great day!
It happens fairly often where you want the titles across all the pages in your website to have a shared pattern.
For instance, no matter what page you're on in Stack Overflow, the title always ends with " - Stack Overflow".
It would be nice if this library provides a feature that allows users to achieve this, it would make it even more superior than it already is to Microsoft's built-in
<Title>
component.I propose a property gets added to
HeadElementHelperServiceOptions
, so that you could do the following:Or something similar.
Without this, we currently have to repeat the suffix on every page:
(Products.razor)
That way, this would suffice:
Nicer, and cleaner.
There could also be a parameter for the
<Title>
component with which you can specify not to use the suffix, this is useful when for example you have a page whose title you want to be unique:The text was updated successfully, but these errors were encountered: