The button renders fine but the URL doesn’t work. It just shows the UDI (umb://document/…….)
I have searched around and found various solutions for previous Umbraco versions but they don’t seem to work in v8.
Is someone able to point me in the right direction for v8? I can get content pickers to work properly in a normal template just not as macro parameter?
When you write out a content picker value normally in a template then a 'Property Value Converter' runs behind the scenes and turns the picked identifier into a representation of the thing that was picked.
But inside a Macro Partial, and with Macro Parameters this magic does not happen :-( so what you are seeing for linkTo is the identifier of the picked content item...
... but you can use this to get your item with the UmbracoHelper's Content method... eg try
Content Picker in Macro Parameter - Can't link to page
Hi
I am using Umbraco 8.1.4 and I am having a little problem with Macro Parameters.
Basically I am trying to use a content picker in a macro parameter and then use the url of the page selected as a link to that page.
The button renders fine but the URL doesn’t work. It just shows the UDI (umb://document/…….)
I have searched around and found various solutions for previous Umbraco versions but they don’t seem to work in v8.
Is someone able to point me in the right direction for v8? I can get content pickers to work properly in a normal template just not as macro parameter?
Thanks
Ben
Hi Ben
When you write out a content picker value normally in a template then a 'Property Value Converter' runs behind the scenes and turns the picked identifier into a representation of the thing that was picked.
But inside a Macro Partial, and with Macro Parameters this magic does not happen :-( so what you are seeing for linkTo is the identifier of the picked content item...
... but you can use this to get your item with the UmbracoHelper's Content method... eg try
regards
Marc
Perfect thanks Marc. I was very close with some of the attempts but was just struggling with the .Url()
That code works a treat and makes complete sense. Thanks mate.
is working on a reply...