I have created the data type and added it to the product document type and it is appearing on the tab but there are no text boxes to add data to the properties:
I have done a test on a 'normal' Umbraco page and it works fine:
angular.min.js?cdv=1172661818:63 TypeError: Cannot read property 'contentTypeAlias' of null
at linker (http://localhost:50173/App_Plugins/Archetype/js/archetype.js?cdv=1172661818:837:136)
at k (http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:44:444)
at e (http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:40:139)
at k (http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:44:382)
at e (http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:40:139)
at k (http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:44:382)
at e (http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:40:139)
at http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:39:205
at http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:162:213
at Object.fn (http://localhost:50173/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1172661818:90:12) <archetype-property class="archetypeEditor ng-isolate-scope ng-scope" property="property" property-editor-alias="model.alias" fieldset-index="$parent.$index" fieldset="fieldset" archetype-config="model.config" property-config-index="$index" archetype-render-model="model.value" umbraco-form="form">
I don't use Merchello, but if my suspicion is correct, you won't be able to use Archetype on a non-content page. I'm assuming that the page you're working on is outside of the 'content' section. Again, I don't use Merchello (not that it's bad :) ).
It seems Merchello does not pass the current editor state to the archetypeProperty directive, so editorState.current is always null.
As a workaround, change the the signature of angular.module("umbraco.directives").directive('archetypeProperty' in \AppPlugins\Archetype\js\archetype.js from
I've managed to get this working for my project. Unfortunately though, it doesn't like nested archetypes :(. If I have one on the form the add button works correctly and lets me add data but when I go back into the form at a later date it won't load the nested form at all. There is an error in the console:
It looks like the second time it runs the init function (for the nested form) it is for some reason, passing $scope.model.value as a string rather than an object. Adding the following to the init function fixes the issue:
if (typeof $scope.model.value == "string") {
$scope.model.value = JSON.parse($scope.model.value);
}
Using Archetype with Merchello
Hi All,
Using Umbraco v7.3.4 & Merchello 1.2.12 & Archetype 1.12.3
I was hoping someone could help with an issue i'm having with using Archetype on Merchello extended product content (i'm trying to achieve something similar to this: https://our.umbraco.org/projects/collaboration/merchello/merchello/69645-tiered-pricing
I have created the data type and added it to the product document type and it is appearing on the tab but there are no text boxes to add data to the properties:
I have done a test on a 'normal' Umbraco page and it works fine:
Any ideas would be greatly appreciated.
Thanks in advance, Kerri
Comment author was deleted
Can you use the Chrome tools to see if a CSS class is hiding the inputs by accident?
Hi Kevin,
The input isn't there in the html, the left hand side is how it appears on the umbraco page, the right hand side is on the Merchello page
Comment author was deleted
Wow that's wild. I'm not sure I can help then :)
Comment author was deleted
Any JS errors?
Comment author was deleted
Well, I think I have bad news.
I don't use Merchello, but if my suspicion is correct, you won't be able to use Archetype on a non-content page. I'm assuming that the page you're working on is outside of the 'content' section. Again, I don't use Merchello (not that it's bad :) ).
The reason being could be tied to the fact that Archetype needs to know information about the current page: https://github.com/imulus/Archetype/blob/6bcf291c99c2da83630ae9ca3208dd14d6c8b4a3/app/directives/archetypeproperty.js#L18
More can be found here: https://github.com/imulus/Archetype/search?utf8=%E2%9C%93&q=contentTypeAlias
So for whatever reason, the information can't be retrieved on the page you're using.
Comment author was deleted
If it IS a content page, is it possible that the Archetype is being wrapped by something from Merchello?
It seems Merchello does not pass the current editor state to the archetypeProperty directive, so editorState.current is always null.
As a workaround, change the the signature of angular.module("umbraco.directives").directive('archetypeProperty' in \AppPlugins\Archetype\js\archetype.js from
to
(add $routeParams to the signature) and then before calling archetypePropertyEditorResource.getDataType in there, add the following lines:
Then change the signature of
to
And we can get the Archetype editor loaded into a Merchello product properly.
Thanks Supun! working a treat :)
Hi Guys,
I've managed to get this working for my project. Unfortunately though, it doesn't like nested archetypes :(. If I have one on the form the add button works correctly and lets me add data but when I go back into the form at a later date it won't load the nested form at all. There is an error in the console:
Can anyone help?
It looks like the second time it runs the init function (for the nested form) it is for some reason, passing $scope.model.value as a string rather than an object. Adding the following to the init function fixes the issue:
This may be a bit hacky but it does seem to work!
I've just applied the fix by Supun which works for me
@Kevin - is there any chance of this going into Archetype package?
is working on a reply...