I have been trying to use the ‘Articles Parent and Article Items - A Parent Page with Infinite Children’ tutorial from https://our.umbraco.org/documentation/tutorials/creating-basic-site/Articles-Parent-and-Article-Items and have hit a stumbling block.
The way I am doing it is slightly different from the tutorial, I want to use this as a way of displaying a group of images in rows of 4 images and when you hover over them and click them the page expands to show more information. Like this:
I have created the macro which is as follows:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{ var selection = CurrentPage.Children.Where("Visible").OrderBy("CreateDate desc"); }
@* OrderBy() takes the property to sort by and optionally order desc/asc *@
@foreach (var item in selection)
{
<li class="mix other">
<a href="javascript:void(0)" data-largesrc="~/images/portfolio/HappyHour.png" data-title="@Umbraco.Field("eventTitle")" data-description="@Umbraco.Field("eventsBodyText", removeParagraphTags: true)">
<img src="~/images/portfolio/HappyHour.png" alt="Happy Hour">
<div class="hover-mask">
<h3>@Umbraco.Field("eventTitle")</h3>
<span><i class="fa fa-plus fa-2x"></i></span>
</div>
</a>
</li>
}
Then in Umbraco I call the Macro from within the ul
<ul id="og-grid" class="og-grid">
<!-- single portfolio item -->
@Umbraco.RenderMacro("listEvents")
<!-- /single portfolio item -->
</ul> <!-- end og grid -->
The first node works fine when like this but any subsequent ones do not show. Also, If I choose to use a media selector to pick the image rather than hard-coding the the ~images/portfolio...... Then the page errors - The code I am replacing the ~images/portfolio...... is:
Articles Parent and Article Items - Macro Issues
I have been trying to use the ‘Articles Parent and Article Items - A Parent Page with Infinite Children’ tutorial from https://our.umbraco.org/documentation/tutorials/creating-basic-site/Articles-Parent-and-Article-Items and have hit a stumbling block. The way I am doing it is slightly different from the tutorial, I want to use this as a way of displaying a group of images in rows of 4 images and when you hover over them and click them the page expands to show more information. Like this:
I have created the macro which is as follows:
Then in Umbraco I call the Macro from within the ul
The first node works fine when like this but any subsequent ones do not show. Also, If I choose to use a media selector to pick the image rather than hard-coding the the ~images/portfolio...... Then the page errors - The code I am replacing the ~images/portfolio...... is:
Even when the image location is hard-coded then the thumbnail shows fine but when selected the main image doesn't.
Finally, The data-title= section doesn't work either.
I think I am in a bit of a pickle, any assistance would be very gratefully received.
Oh, and Happy New Year to you all :)
Ben
Is it possible to do it this way? Adding an Umbraco page field into JS must be possible somehow?
If not, is there another way that I could do it? Im stuck on an almost complete project without this.
Thanks
Ben
I guess what I want to do here is not possible or I am using it incorrectly.
I will see if I can think of a different way to do it.
Thanks anyway
Ben
is working on a reply...