is it possible to extend an existing Umbaco directive?
The one I wish to extend is the umb-node-preview with an extra property called allow-preview and a property which will be executing a function called on-preview.
Then finally also a new property called asignto which will be a user from the backoffice.
Is this even possible? I don't want to complete create my own directive because 80% works with the existing umbraco umb-node-preview directive.
Extend existing Umbraco directive
Hi community,
is it possible to extend an existing Umbaco directive?
The one I wish to extend is the
umb-node-preview
with an extra property calledallow-preview
and a property which will be executing a function calledon-preview
.Then finally also a new property called
asignto
which will be a user from the backoffice.Is this even possible? I don't want to complete create my own directive because 80% works with the existing umbraco
umb-node-preview
directive.Thanks in advance!
/Michaël
https://stackoverflow.com/questions/19987538/angularjs-extended-directive-controller
That may be able to help you.
Mind you, I haven't looked in to the specific directive to see if its build like that.
Ok after searching in the source code, I found that this directive has another property called
allow-open
and a callbackon-open
so I used this.https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/src/Umbraco.Web.UI.Client/src/common/directives/components/umbnodepreview.directive.js
For the
asignto
property I passed this through with the description property./Michaël
I see you already tackled your issue.
But maybe a good read anyways : http://skrift.io/articles/archive/changing-backoffice-functionality-without-changing-core-code/
Dave
Thanks Dave! Didn't know it was possible for also extending controllers so that you can use the core controller functions from Umbraco.
/Michaël
is working on a reply...