Grab macro variable and pass it to doc type property using a template
Hey everyone,
I have a YouTube macro that takes a url and adjusts
the url so that you get just the video, and I have a variable in the macro that
has the new url. I then have a banner doc type that has a link property
which the user may enter a url, in the banner template I call the YouTube
macro. I then want to take the variable inside the macro and set the link
property with the new adjusted YouTube string.
Grab macro variable and pass it to doc type property using a template
Hey everyone,
I have a YouTube macro that takes a url and adjusts the url so that you get just the video, and I have a variable in the macro that has the new url. I then have a banner doc type that has a link property which the user may enter a url, in the banner template I call the YouTube macro. I then want to take the variable inside the macro and set the link property with the new adjusted YouTube string.
I apologize if this is in the wrong section.
This is the template code:
I dubbuged this through Visual Studio and I know it grabs the link properly.
YouTube Macro:
The string variable 'url' is the one I would like to grab, I added it in hopes of being able to access it from outside the macro.
Thanks!
I think this wiki can help you: http://our.umbraco.org/wiki/reference/templates/umbracomacro-element
If you change your macro to this it should work:
Jeroen
is working on a reply...