Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
hello community,
I'd like to use an image that the user inserts through a mediapicker as the background of a table, could anyone tell how to do it?
or in a more generic way, how to get the image or media path to get the file of the media file that the user has inserted in the content area.
thanks in advance,
Regards,
Ricardo
Here's a short macro to get the current page banner (assuming it's stored in a mediapicker property of 'pageBannerImage'
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library"><xsl:output method="xml" omit-xml-declaration="yes"/><xsl:param name="currentPage"/><xsl:template match="/"> <xsl:if test="$currentPage/data [@alias='pageBannerImage'] != ''"> <div class="page_header"> <img alt="{$currentPage/@nodeName}"> <xsl:attribute name="src"> <xsl:value-of select="umbraco.library:GetMedia($currentPage/data [@alias='pageBannerImage'], 'false')/data [@alias = 'umbracoFile']" /> </xsl:attribute> </img> </div> </xsl:if></xsl:template></xsl:stylesheet>
Now to set as a background
<xsl:if test="$currentPage/data [@alias='pageBannerImage'] != ''"> <div> <xsl:attribute name="style"> <xsl:text>background:url(</xsl:text><xsl:value-of select="umbraco.library:GetMedia($currentPage/data [@alias='pageBannerImage'], 'false')/data [@alias = 'umbracoFile']" /><xsl:text>) left top repeat-x;</xsl:text> </xsl:attribute> </div> </xsl:if>
or something to that effect!
Dan
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Image from media picker as background of table
hello community,
I'd like to use an image that the user inserts through a mediapicker as the background of a table, could anyone tell how to do it?
or in a more generic way, how to get the image or media path to get the file of the media file that the user has inserted in the content area.
thanks in advance,
Regards,
Ricardo
Here's a short macro to get the current page banner (assuming it's stored in a mediapicker property of 'pageBannerImage'
Now to set as a background
or something to that effect!
Dan
is working on a reply...