Finally realized from the html that the literal 'Fig3' was providing the path, not the name, so added a var to hold the name and, after much pondering and 1k trials/errors, figured out how to pass it along to the img tag, thusly:
// get the figure to use @{var fig = Model.figure;
<ul> // get a list of content pages to use from the ultimatepicker and split it up @foreach (var Node in Model.figurePages.Split(',')) { // get the current node of the foreach loop var curNode = Library.NodeById(Node); // get the image path from the current node var pic = curNode.Media(fig); // display the name of the content page that the image comes from <p><strong>@curNode.Name</strong><br/> // display the image from the var 'pic' <img src="@pic.umbracoFile" width=550 /> </p> } </ul> }
Get images from other nodes
I'm trying to render a page with a list of all images (figures) of the same property name ('Fig3', for instance) from selected pages.
On the content page, using an ultimate picker 'figurePages', I select the pages I want, then enter the media property name I want listed.
Although this script works, with the figure name 'Fig3' entered manually:
It doesn't if I use the property 'figure' instead, although the @Model.figure in the <p> above shows it has the correct value of 'Fig3':
I've tried several variations but haven't found the magic jelly bean. Help?
Tried adding a variable on top to carry the 'figure' property value inside the loop but that didn't work either...
Nor with @fig either. Still looking for any help, appreciated.
And for clarity, entering the property value directly ('Fig4') renders this html:
But using the property or variable, it does this:
Also tried republishing the entire site to clear the cache. Still no love...
Finally realized from the html that the literal 'Fig3' was providing the path, not the name, so added a var to hold the name and, after much pondering and 1k trials/errors, figured out how to pass it along to the img tag, thusly:
Hopefully this helps some future dufus.
is working on a reply...