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,
I am attempting to insert a value into a call to a macro from within a template. Originally the macro call looked like:
<umbraco:Macro Url="http://www.mywebsite.com/include.php?part=banner&id=101&ver=3" Alias="ForeignContentFetcher" runat="server"></umbraco:Macro>
I need to be able to change the id=101 to 102, 103, 104 etc
My following code builds the Url correctly however i am unsure how i can insert it into the call to the macro.
<umbraco:Macro runat="server" language="cshtml">
<p>@Library.NodeById(Model.place).Code ---</p>
@{
string code = Library.NodeById(Model.place).Code;
string bannerID = "101";
switch (code) {
case "abc":
bannerID = "102";
break;
case "def":
bannerID = "103";
default:
}
string myurl = "http://www.mywebsite.com/include.php?part=banner&id=" + bannerID + "&ver=3";
</umbraco:Macro>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Calling a macro from within a macro
Hi,
I am attempting to insert a value into a call to a macro from within a template. Originally the macro call looked like:
<umbraco:Macro Url="http://www.mywebsite.com/include.php?part=banner&id=101&ver=3" Alias="ForeignContentFetcher" runat="server"></umbraco:Macro>
I need to be able to change the id=101 to 102, 103, 104 etc
My following code builds the Url correctly however i am unsure how i can insert it into the call to the macro.
<umbraco:Macro runat="server" language="cshtml">
<p>@Library.NodeById(Model.place).Code ---</p>
@{
string code = Library.NodeById(Model.place).Code;
string bannerID = "101";
switch (code) {
case "abc":
bannerID = "102";
break;
case "def":
bannerID = "103";
break;
default:
break;
}
string myurl = "http://www.mywebsite.com/include.php?part=banner&id=" + bannerID + "&ver=3";
}
</umbraco:Macro>
is working on a reply...