I have a composite I would like to use in multiple document types, however, I would like the tab name to be different depending on which document type I'm using it on.
In this specific example, I'm using a "background" composite in some types where I'd like it to be named something like "Background Settings".
However I would also like to use it on another document types where it could be named for example: "Header Background"
So basically - changing the tab's display name for the composite depending on it's inclusion in different document types/locations without needing to make duplicate composites.
The way the concept of properties in Umbraco has evolved over the years, and the corresponding database storage, means a particular property in a document type is very tied to the 'tab' it has been added to.
The changes required to make possible what you describe, (though very intuitively how you might expect it to work) would be prohibitively big...
Anyway more pragmatically some options:
1) If you called your tab just 'Background' then in both scenarios it would probably make sense to the editor!
2) Duplicate the composition, really theoretically you could argue although in the two scenarios you currently require the same 'properties' - that perhaps at a future date, the header background scenario might require an additional property, that the other scenario doesn't require, so they 'should be different' compositions (their properties can have the same name - and you can use the copy function so you don't have to retype them!), essentially the idea that the tabs should have different titles for the editors sort of implies they are 'different' things albeit 'really similar' :-P
3) Finally, if you really must... you can programmatically change the title of the tab before it is rendered to the editor in the two different circumstances, based on the alias of the document type - you achieve this by handling the EditorModelEventManager SendingContentModel event, finding the Tab, and updating it's Label...
Thanks for the comprehensive answer - I was "afraid" it was like that - but I had hoped the display name was merely a text value/translation in the association between the composite and the "final" document type as it could be seperated from the system name. :)
Anyway - thanks once again, I'm going the more 'generic' route in the naming, as the issue is not 'too critical' but merely a UX issue. :)
Overwrite/Dynamic Composite Tab Names
Hi.
I have a composite I would like to use in multiple document types, however, I would like the tab name to be different depending on which document type I'm using it on.
In this specific example, I'm using a "background" composite in some types where I'd like it to be named something like "Background Settings". However I would also like to use it on another document types where it could be named for example: "Header Background"
So basically - changing the tab's display name for the composite depending on it's inclusion in different document types/locations without needing to make duplicate composites.
Is this possible somehow?
Hi Allan
No this isn't specifically possible 'easily'
The way the concept of properties in Umbraco has evolved over the years, and the corresponding database storage, means a particular property in a document type is very tied to the 'tab' it has been added to.
The changes required to make possible what you describe, (though very intuitively how you might expect it to work) would be prohibitively big...
Anyway more pragmatically some options:
1) If you called your tab just 'Background' then in both scenarios it would probably make sense to the editor!
2) Duplicate the composition, really theoretically you could argue although in the two scenarios you currently require the same 'properties' - that perhaps at a future date, the header background scenario might require an additional property, that the other scenario doesn't require, so they 'should be different' compositions (their properties can have the same name - and you can use the copy function so you don't have to retype them!), essentially the idea that the tabs should have different titles for the editors sort of implies they are 'different' things albeit 'really similar' :-P
3) Finally, if you really must... you can programmatically change the title of the tab before it is rendered to the editor in the two different circumstances, based on the alias of the document type - you achieve this by handling the EditorModelEventManager SendingContentModel event, finding the Tab, and updating it's Label...
https://our.umbraco.com/documentation/reference/events/EditorModel-Events
eg Create a class that implements IApplicationEventHander, and wire up to the SendingContentModel event:
Thanks for the comprehensive answer - I was "afraid" it was like that - but I had hoped the display name was merely a text value/translation in the association between the composite and the "final" document type as it could be seperated from the system name. :)
Anyway - thanks once again, I'm going the more 'generic' route in the naming, as the issue is not 'too critical' but merely a UX issue. :)
is working on a reply...