Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi Richard,
is there a way to at the parent nodename into the template for a document type?
Something like:
[#@nodename] | [#@parent.nodeName] | Company 2017
Have a nice day!
/Michaël
You can use [$parent-property-that-does-not-exists-on-currentdocument] then it will do a recursive lookup.
Richard,
and what if it exists on the current and parent node, eg the nodeName of the node?
Would be nice to automatically add the current node his parent node name to the template.
Not sure if that will work with [$..] parameter.
like I said on twitter will make some sort of mirror unique property on the parent node which contains the same value as its name which we then can call recursive on the child node template.
Will let you know it this is working as expected!
For anyone else that wants to achieve this, below is the solution:
Create a new property editor ( in my case Property Mirror ) which contains the following html:
<div ng-controller="Mivaweb.PropertyMirrorController"> <input type="text" class="umb-editor umb-textstring" ng-model="model.value" disabled="disabled" /> </div>
then my controller looks like:
angular.module("umbraco") .controller("Mivaweb.PropertyMirrorController", function ($scope, editorState) { $scope.editorState = editorState; $scope.model.value = $scope.editorState.current.name; $scope.$watch('editorState.current.name', function (newVal) { $scope.model.value = newVal; }); } );
As you can see, the only thing I do is watching the name of the node and set a mirror property the same as the name.
Then in my child node, on the SEO Checker template I use the alias of my parent unique property to get the value:
[#@seoTitle] | [$nameMirror] | Dierenarts Oosterlinck
@Richard: Maybe something to implement into the seo checker core?
Hope this helps!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Add parent nodename to the template in SEO Checker
Hi Richard,
is there a way to at the parent nodename into the template for a document type?
Something like:
Have a nice day!
/Michaël
You can use [$parent-property-that-does-not-exists-on-currentdocument] then it will do a recursive lookup.
Richard,
and what if it exists on the current and parent node, eg the nodeName of the node?
Would be nice to automatically add the current node his parent node name to the template.
/Michaël
Not sure if that will work with [$..] parameter.
Richard,
like I said on twitter will make some sort of mirror unique property on the parent node which contains the same value as its name which we then can call recursive on the child node template.
Will let you know it this is working as expected!
/Michaël
For anyone else that wants to achieve this, below is the solution:
Create a new property editor ( in my case Property Mirror ) which contains the following html:
then my controller looks like:
As you can see, the only thing I do is watching the name of the node and set a mirror property the same as the name.
Then in my child node, on the SEO Checker template I use the alias of my parent unique property to get the value:
@Richard: Maybe something to implement into the seo checker core?
Hope this helps!
/Michaël
is working on a reply...