Media items referenced by richtext editor through macros
We've got a project with a couple of macros to use in RichText Editor.
Specifically this simple one, which is used to add buttons for internal/external links or media items.
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
var links = Model.GetParameterValueAsLinks("links");
}
@if (links != null)
{
foreach (var link in links)
{
<a class="a-button u-bg-color--secondary" href="@Html.Raw(link.Url)" target="@link.Target">@link.Name</a>
}
}
The problem is that when you choose a media item, the media item will not show it being used in media archive, which in turn results in web editors deleting media items that looks like they're not in use, but really are.
Unfortunately I don't believe it is possible, you would probably need to write a custom angular plugin to do it as you would need to parse the macro data.
Would be nice if it worked with macros, since it does through the build-in link and media picker through richtext. Perhaps some day :)
I will update if i find a fairly simple way to code it.
Media items referenced by richtext editor through macros
We've got a project with a couple of macros to use in RichText Editor.
Specifically this simple one, which is used to add buttons for internal/external links or media items.
The problem is that when you choose a media item, the media item will not show it being used in media archive, which in turn results in web editors deleting media items that looks like they're not in use, but really are.
Example of media item showing it being used. I have tried to include data-udi in the tag, but unfortunately without luck. (
<a data-udi="umb://media/10b31c0f862244fbbcbb51f4a48bbcf8" href="...
)Couldn't find any information about this, is it even possible to create the reference when used through a macro?
Hi Nikolaj,
Unfortunately I don't believe it is possible, you would probably need to write a custom angular plugin to do it as you would need to parse the macro data.
Hi Huw.
Thank you for such a quick reply!
Would be nice if it worked with macros, since it does through the build-in link and media picker through richtext. Perhaps some day :) I will update if i find a fairly simple way to code it.
Have a great weekend!
is working on a reply...