Hello The macro show photos in full size in the RTE, and i want them to be showed in like 500px. Just like when you use the normal mediapicker in the RTE. The macro works fine at my website, but is just hard to use it in the RTE when the photos shows in full size
Hope that someone can help me :)
The macro looks like this:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
<link href="~/css/lightbox.css" rel="stylesheet" />
<script src="~/js/lightbox.js"></script>
@*
Macro to display a gallery of images from media the media section.
Works with either a 'Single Media Picker' or a 'Multiple Media Picker' macro parameter (see below).
How it works:
- Confirm the macro parameter has been passed in with a value
- Loop through all the media Id's passed in (might be a single item, might be many)
- Display any individual images, as well as any folders of images
Macro Parameters To Create, for this macro to work:
Alias:mediaIds Name:Select folders and/or images Type: Multiple Media Picker
Type: (note: you can use a Single Media Picker if that's more appropriate to your needs)
*@
@{ var mediaIds = Model.MacroParameters["mediaIds"]; }
@if (mediaIds != null)
{
<ul class="thumbnails" style="padding: 0px">
@foreach (var mediaId in mediaIds.ToString().Split(','))
{
var media = Umbraco.Media(mediaId);
@* a single image *@
if (media.DocumentTypeAlias == "Image")
{
@Render(media);
}
@* a folder with images under it *@
if (media.Children("Image").Any())
{
foreach (var image in media.Children("Image"))
{
@Render(image);
}
}
}
</ul>
}
@helper Render(dynamic item)
{
<li class="col-md-3" style="list-style: none;">
<a href="@item.umbracoFile.src" data-lightbox="gallery" data-title="@item.Name" class="thumbnail">
<img src="@item.umbracoFile.src" alt="@item.Name" />
</a>
</li>
}
Gallery - Macro
Hello The macro show photos in full size in the RTE, and i want them to be showed in like 500px. Just like when you use the normal mediapicker in the RTE. The macro works fine at my website, but is just hard to use it in the RTE when the photos shows in full size
Hope that someone can help me :)
The macro looks like this:
Hi Morten,
Do you use some styles in the RTE?
Do you know that you can add styles to RTE?
At the Rich Text Editor settings you can add style sheets file, and specify image sizes and other stuff in this file.
Thanks,
Alex
Hi Morten,
Did you solve the issue?
Thanks
Sorry, didnt see your replay.
I didnt know about the style for RTE, i will try make some code that will handle it :)
Thanks
is working on a reply...