Reputation:
We are working on Sitecore application. There is our vendor team is using sitecore item DisplayName as a page title. As per my knowledge this is wrong approach. But i need your help please give me a strong reason i can prove this approach is wrong.
If this is right way then please suggest that also. Thanks in advance.
Upvotes: 0
Views: 922
Reputation: 686
I agree that there is nothing wrong technically but I don't think its the correct approach.
Display Name field is for all the sitecore items and I believe the mainly purpose is to show in the content editor tree.
I'd suggest that is a good practice that all your page templates inherit from base templates/interfaces where you have the page related fields like Page Title, Navigation Link Title etc.
Upvotes: 0
Reputation: 7994
There is nothing inherently 'wrong' in using the Display Name of an item for a page title. As @Piotr Wicijowski mentions, it is better than using the item name. The Display Name can also be used for different languages, unlike the item name.
However, there are a few issues (in addition to Piotr's post) with using Display Name as the page title:
On the flip side, there are some benefits to using the Display Name:
Upvotes: 1
Reputation: 2115
As opposed to using item Name
(which has a lot of restrictions, like disallowed characters and not being able to have different values per language), using DisplayName
for page title can, in fact, be a good choice, for the following reasons:
The only possible downside is the fact that DisplayName
field is unversioned, which means that you won't be able to have different values per item version.
Upvotes: 0