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
as title says i have a razor macro pulling information from another node ( dynamic), and on that node is a macro, that i need to pull ...
@using umbraco.MacroEngines @inherits umbraco.MacroEngines.DynamicNodeContext @if (PageData.Count > 0){ dynamic Library = new DynamicNode(PageData[0]);
and under that i can use
@Library.Fieldname
to pull information from the page.
However now i have this macro that pulls lots of fields from that page depending on dates.
@RenderPage("/macroScripts/[Bibliotek]OpeningHours.cshtml")
and in that macro i am using Model.Fieldname for information and checking of dates.
Now, i get that Model in this case isnt correct as the pagedata thingy is something different.
so basicly, how do i pull the model.fieldname from the renderpage script on this page?
example of field in the renderpage macro
if ((Model.visasFranPask<DateTime.Now.Date) && (Model.visasTillPask>DateTime.Now.Date)) { <h2>@Dictionary.EasterOpeningHours </h2> @Model.pask }
/M
noone?
just a guess...
ViewData["fieldname"]
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Razor: Dynamicnode and Macro with model. from elsewhere
as title says i have a razor macro pulling information from another node ( dynamic), and on that node is a macro, that i need to pull ...
and under that i can use
to pull information from the page.
However now i have this macro that pulls lots of fields from that page depending on dates.
and in that macro i am using Model.Fieldname for information and checking of dates.
Now, i get that Model in this case isnt correct as the pagedata thingy is something different.
so basicly, how do i pull the model.fieldname from the renderpage script on this page?
example of field in the renderpage macro
/M
noone?
just a guess...
ViewData["fieldname"]
is working on a reply...