Last active
August 29, 2015 14:18
-
-
Save kgiszewski/38c20f271b63720edad3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Register some JS with Umbraco | |
//~/App_Plugins/ArchetypeLabelTemplates/package.manifest | |
{ | |
"javascript": [ | |
"~/App_Plugins/ArchetypeLabelTemplates/urlpicker.js" | |
] | |
} | |
//Define your label code here | |
//~/App_Plugins/ArchetypeLabelTemplates/urlpicker.js | |
var UrlPickerTemplate = {}; | |
UrlPickerTemplate.getTitle = function (value, scope) { | |
//this is the property model | |
if (value) { | |
return value.meta.title; | |
} | |
//if you wanted to get the name of the content instead, you'd have to get it from the server here since it's not in the model | |
return ""; | |
}; | |
//Use a function in your config | |
//Archetype config GUI | |
Label Template: {{UrlPickerTemplate.getTitle(nameOfPropertyAlias)}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment