Ok, happy to hear that :) - But if you're stuck with an issue like this later on then keep in mind that you can get some more detailed information by having a look in the log files :)
Have you added the parameters to the marco. It should look something like this:
The important part is the alias of the marcos params is matching your code, in your case controls and mp3. When you inserted the macro you will need to pick a file and a content node in my example. When you have done this. The code for the macro that you have inserted should look something like this.
@Umbraco.RenderMacro("Audio html5", new {controls="1068", mp3="1078"})
The name Audio html5 is my name of the partial view macro
HTML 5 Audio Macro
This is the code I have that has been converted to be used with umbraco 7 but it dosetn work . Can anyone help?
I keep getting this error : Error loading Partial View script (file: ~/Views/MacroPartials/InsertAudio.cshtml)
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
var mp3Id = Model.MacroParameters["mp3"].ToString();
var mp3 = Umbraco.TypedMedia(mp3Id);
var mp3Url = mp3 != null ? mp3.Url : string.Empty;
var controlsTog = string.Empty;
if (string.Equals(Model.MacroParameters["controls"].ToString(), "1"))
{
controlsTog = "controls";
}
}
@if (!string.IsNullOrEmpty(mp3Url))
{
<audio @controlsTog>
<source src="@mp3Url" type="audio/mpeg" />
Your browser does not support the audio tag.
</audio>
}
Hi Stefan and welcome to our :)
Could you have a look in the /App_Data/Logs file and see if it reveals a more detailed description of the error? It should be marked with "ERROR".
/Jan
Got it working . Turns out i didnt have the right macro parameter aliases.
Hi Stefan
Ok, happy to hear that :) - But if you're stuck with an issue like this later on then keep in mind that you can get some more detailed information by having a look in the log files :)
Happy coding.
/Jan
Hi Stefan and welcome to our.,
Have you added the parameters to the marco. It should look something like this:
The important part is the alias of the marcos params is matching your code, in your case controls and mp3. When you inserted the macro you will need to pick a file and a content node in my example. When you have done this. The code for the macro that you have inserted should look something like this.
The name Audio html5 is my name of the partial view macro
Hope this helps,
/Dennis
is working on a reply...