Reputation: 709
Please bear with me because I am very new to Umbraco.
I have a test Umbraco config file that looks like the following:
<Product nodeName="For-test">
<customId>222/</customId>
</Product>
<Product nodeName="For-none">
<customId>333/</customId>
</Product>
In my test.master page, I would only like to match the child element who's parent has the value of "For-test". This should give me the value of "222". I am using the following code to display the element values but I get the following error "Error loading MacroEngine script (file: )" I believe that my syntax is wrong.
<umbraco:Macro runat="server" language="cshtml">
@Model.nodeName="For-test".customId;
</umbraco:Macro>
Upvotes: 0
Views: 105
Reputation: 773
For a detailed error go to App_Data/Logs/ and open the newest .txt file.
Upvotes: 0
Reputation: 3425
Which Umbraco version are you using? Version 7 is best when using MVC, so you wouldn't typically have a master page at all.
Also, you shouldn't have to be fiddling with umbraco.config at all.
I would suggest you start by installing the starter kit (maybe in a fresh install?), then you can check out how "it" does things. Also, have a good look in the documentation (https://our.umbraco.org/documentation/) and maybe even check out some of the video tutorials (something like these http://umbraco.tv/videos/umbraco-v7/implementor/fundamentals/templating/).
As for your specific question:
<umbraco:Macro />
tag - but since you are in a Web Forms type website (and not MVC), you can't use @ to indicate code sections. You'll have to try with <%= %>
.But I think you can get a much better grasp of how things are done in Umbraco by looking at the links provided above.
Upvotes: 4