<div id="slider"> <ul id="sliderContent"> <li class="sliderImage"> <img src='<umbraco:Item field="photo" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by TOUHID"/> <span class="top"><strong>Title text 1</strong><br /></span> </li> <li class="sliderImage"> <img src='<umbraco:Item field="photo1" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/> <span class="top"><strong>Title text 2</strong><br /></span> </li>
<li class="sliderImage"> <img src='<umbraco:Item field="photo2" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/> <span class="top"><strong>Title text 2</strong><br /></span> </li> <li class="sliderImage"> <img src='<umbraco:Item field="photo3" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/> <span class="top"><strong>Title text 2</strong><br /></span> </li>
<li class="sliderImage"> <img src='<umbraco:Item field="photo4" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/> <span class="top"><strong>Title text 2</strong><br /></span> </li> <li class="sliderImage"> <img src='<umbraco:Item field="photo5" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/> <span class="top"><strong>Title text 2</strong><br /></span> </li>
problem with image in a page
hi,
In a content a page there are three image upload . and i upload first two image and last is not.
now my problem is the third image icon is shown which i cant want. how can i solve this problem??
pls any one help me?
touhid
Hi touhid,
You will probably need to use a macro to check if an image has been selected. Check this post for an example:
http://our.umbraco.org/forum/developers/xslt/5527-Macro-to-show-an-image-from-Media
If you post your template/macro code that you are using to render the image we will be able to help further
thanks for quick reply. now i m doing that..
Sory,its late. by the by i could not it successfully. my xslt file and template where i used macro are as follows-( i used a upload data type)
now what can i do?
xslt:-
<?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="mediaId" select="/macro/mediaId"/>
<xsl:template match="/">
<xsl:if test="$mediaId > 0">
<xsl:variable name="image" select="umbraco.library:GetMedia($mediaId,'true')"/>
<img src="{$image/data[@alias='umbracoFile']}" alt="{$image/@nodeName}">
<xsl:if test="/macro/style != ''">
<xsl:attribute name="style"><xsl:value-of select="/macro/style"/></xsl:attribute>
</xsl:if>
</img>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Template:-
<%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>
<asp:content ContentPlaceHolderId="MainContent" runat="server">
<umbraco:Item field="header" runat="server"></umbraco:Item>
<umbraco:Macro Alias="Breadcrumb" runat="server"></umbraco:Macro>
<umbraco:Item field="text" runat="server"></umbraco:Item>
<umbraco:Macro mediaId="-90" style="" Alias="Specialties" runat="server"></umbraco:Macro>
<script language="JavaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script language="JavaScript" src="/scripts/s3Slider.js"></script>
<script language="JavaScript">
$(document).ready(function() {
$('#slider').s3Slider({
timeOut: 3000
});
});
</script>
<div id="slider">
<ul id="sliderContent">
<li class="sliderImage">
<img src='<umbraco:Item field="photo" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by TOUHID"/>
<span class="top"><strong>Title text 1</strong><br /></span>
</li>
<li class="sliderImage">
<img src='<umbraco:Item field="photo1" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/>
<span class="top"><strong>Title text 2</strong><br /></span>
</li>
<li class="sliderImage">
<img src='<umbraco:Item field="photo2" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/>
<span class="top"><strong>Title text 2</strong><br /></span>
</li>
<li class="sliderImage">
<img src='<umbraco:Item field="photo3" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/>
<span class="top"><strong>Title text 2</strong><br /></span>
</li>
<li class="sliderImage">
<img src='<umbraco:Item field="photo4" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/>
<span class="top"><strong>Title text 2</strong><br /></span>
</li>
<li class="sliderImage">
<img src='<umbraco:Item field="photo5" runat="server"></umbraco:Item>' height="128" width="128" alt="Photo taken by T "/>
<span class="top"><strong>Title text 2</strong><br /></span>
</li>
<div class="clear sliderImage">
</div>
</ul>
</div>
</asp:Content>
is working on a reply...