This is about to drive me completely insane!
I’ve done this before and I know it should work and it’s supposed to be straightforward.
I’ve created a macro which is like this
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
string ParameterName = Parameter.Name;
<span>@ParameterName</span>
}
and on the page:
<umbraco:macro Alias="MasterpageParameter" language="cshtml" runat="server" Name="logoText"></umbraco:macro>
The macro registers successfully (because I can print other data on the screen and in thise case I can see the gets printed otu) but the Parameter is always empty. I’ve tried lower case, other names (e.g Param1 Param2 etc) and the Parameter is always empty.
I am sure I’ve done something identical in another project before which worked fine.
Can’t possibly find out what’s stopping this macro from working.
What’s even worse is that if I add a property on a DocumentType i.e. “IsReadable” what I previously did on a previous project was loop through the pages and say something like if(item.IsReadable) etc. Now, using the same version of Umbraco ALL dynamic variables are empty. Something seems to be seriously wrong here but I don’t know how to fix it.
I’m using umbraco v 4.7.1.1 (Assembly version: 1.0.4393.24044)
Any help please?
I solved it by adding these:
Probably only some of them are needed, but I haven’t bothered to find out.
Adding just MacroEngines isn’t enough though…
It’s bizarre cause on a previous project these aren’t needed. Perhaps they are not properly referenced in the web.config in this project or something like that. Anyway it works now so I’m happy