Greg since your are adding this value in the Template you should at least be getting something. Have you try adding this field by simply using the "Insert Umbraco Page Field" ?
That blog post isn't a whole lot of use to me really... i'll try to make a macro to render the image later one - i'm concentrating on finishing the site, hoping somebody will have a workaround for this by the time i really need it :)
Error rendering Item 8 (NodeId '' : headerImage). Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Umbraco.Web.umbraco.templateControls.Resources.resources" was correctly embedded or linked into assembly "umbraco" at compile time, or that all the satellite assemblies required are loadable and fully signed. at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName) at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at umbraco.presentation.templateControls.ItemRenderer.XsltTransform(String xpath, String itemData, Boolean disableEscaping) at umbraco.presentation.templateControls.ItemRenderer.Render(Item item, HtmlTextWriter writer)
ok as a test I changed the name of getmedia to getmediax to see what error I would get and it's the same error, so I can only assume that it's as if the function doesn't exist any more.
Insert Media Library Image into Template in 4.9
I'm really struggling with this... here's what i've tried:
They all just render nothing (except the textarea, which renders an empty text area). This is driving me crazy, can anybody help?
Hi Greg,
Can you please try changing this
to
//fuji
Thanks Fuji, but still no go - renders nothing. :(
Out of curiousity do you actually get the <img> tag at least ?
Nope, nothing at all renders
I just installed v4.9 but didnt have a go yet, looks to me that you are not even rendering the <img> tag. Have you tried the other way round?
That just renders out an empty img tag, as expected.
Pretty sure its the GetMedia() function that isn't working. Has anybody been able to make this work on 4.9?
Greg since your are adding this value in the Template you should at least be getting something. Have you try adding this field by simply using the "Insert Umbraco Page Field" ?
You should be getting an Id at least.
Yes, I get the media ID if i insert the item without the xslt.. which is why i think the Getmedia() function is broken...
Not sure but try this again .featureImage
If not have a look at Lee Kellecher Blogs, it might help.
//fuji
Nah nothing using .featureImage either. ugh!
That blog post isn't a whole lot of use to me really... i'll try to make a macro to render the image later one - i'm concentrating on finishing the site, hoping somebody will have a workaround for this by the time i really need it :)
I've got exactly the same problem. Help!
I get this with ?umbDebugShowTrace=true
headerImage is the name of the image field.
Error rendering Item 8 (NodeId '' : headerImage).
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Umbraco.Web.umbraco.templateControls.Resources.resources" was correctly embedded or linked into assembly "umbraco" at compile time, or that all the satellite assemblies required are loadable and fully signed.
at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName)
at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at umbraco.presentation.templateControls.ItemRenderer.XsltTransform(String xpath, String itemData, Boolean disableEscaping)
at umbraco.presentation.templateControls.ItemRenderer.Render(Item item, HtmlTextWriter writer)
Greg, is your problem on a new install or an Upgrade?
Mine is an upgrade and I'm wondering if that's something to do with it.
ok as a test I changed the name of getmedia to getmediax to see what error I would get and it's the same error, so I can only assume that it's as if the function doesn't exist any more.
ok it must be some kind of referencing thing. It works fine from a macro but no longer directly in a template.
I've made a macro, bit more hassle but gets me over the issue:
<xsl:if test="string($currentPage/headerImage) != '' ">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="umbraco.library:GetMedia($currentPage/headerImage, 'false')/umbracoFile" />
</xsl:attribute>
</xsl:element>
</xsl:if>
I made a Razor macro to get around this.. here it is if anybody is interested:
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
var mediaId = @Parameter.MediaNode;
var mediaUrl = @Model.MediaById(mediaId).umbracoFile; // @Model.Media(mediaId, "umbracoFile");
var altText = @Parameter.AltText;
var alignment = @Parameter.Alignment;
if (!String.IsNullOrEmpty(mediaUrl))
{
<imgsrc='@mediaUrl'alt="@altText"align="@alignment"/>
}
}
is working on a reply...