Jump to content
Sign in to follow this  
Vikas khartude

Image Gallery issue with multiple containers of different types

Recommended Posts

-I am generating image gallery that suports different types of containers. ie 33% container,50%container and 100 % container. -if container is of type 33% percent then three containers will come in one row separated by verticle line and margin. I want to remove left margin of first container and right margin last container.-if container is of type 50% percent then two containers will come in one row separated by verticle line and margin. I want to remove left margin of first container and right margin other container. -if container is of type 100% percent then only one container is there and no need to remove margin.-Issue is that when multiple containers of this types are present in image gallery in any sequence then how predict which containers rignt margin and line separator has to remove. how to do this?

 

following is xsl file:

 

<xsl:when test="intLayoutType = 219">

<xsl:if test="intNum4 = 2">
<![CDATA[<div class=three_column]]>
<xsl:if test="position() = 1">
<![CDATA[style=margin-left: 0px]]>
</xsl:if>
<xsl:if test="position() = last()">
<![CDATA[style=margin-right: 0px; border-right:none]]>
</xsl:if>
<xsl:if test="preceding-sibling::intNum4[1]=2 and preceding-sibling::intNum4[2]=2">
<![CDATA[style=margin-right: 0px; border-right:none]]>
</xsl:if>
<![CDATA[>]]>
</xsl:if>
<xsl:if test="intNum4 = 1">
<![CDATA[<div class=two_column]]>
<xsl:if test="position() = 1">
<![CDATA[style=margin-left: 0px]]>
</xsl:if>
<xsl:if test="position() = last() ">
<![CDATA[style=margin-right: 0px; border-right: none]]>
</xsl:if>
<xsl:if test="position() mod 2 = 0">
<![CDATA[style=margin-right: 0px; border-right: none]]>
</xsl:if>
<![CDATA[>]]>
</xsl:if>
<xsl:if test="intNum4 = 0">
<![CDATA[<div class="one_column">]]>
</xsl:if>
<WD:ContentController MenuPosition="Content" ResourceFamily="CNT" runat="server">
<xsl:attribute name="contentId">
<xsl:value-of select="autContentId"/>
</xsl:attribute>
<ContentTemplate>
<!--for 33% container and 50% container-->
<xsl:if test="intNum4 = 2 or intNum4 = 1">
<![CDATA[<div class="gallery_margin_right">]]>
<xsl:if test="string-length(vchTitle) > 0">
<![CDATA[<h1 class="gallery_title">]]>
<xsl:value-of select="vchTitle" />
<![CDATA[</h1>]]>
</xsl:if>
<!--Website display-->
<xsl:if test="string-length(vchImageUrl1) > 0">
<![CDATA[<asp:Image runat=server" class="gallery_img" ImageUrl=]]><xsl:value-of select="vchImageUrl1" />
<![CDATA[" ToolTip="]]><xsl:value-of select="vchImageAltText1" />
<![CDATA[" AlternateText="]]><xsl:value-of select="vchImageAltText1" />
<![CDATA[" />]]>
</xsl:if>
<!--<div>
<xsl:value-of select="vchTxt1" />
</div>-->
<![CDATA[<div class="gallery_description">]]><xsl:value-of select="vchTxt1" />
<![CDATA[</div>]]>
<xsl:if test="string-length(vchTxt4) > 0">
<![CDATA[<p class="gallery_plink">]]>
<![CDATA[<asp:HyperLink runat=server" class="gallery_link" Text=]]><xsl:value-of select="vchTxt4" />
<![CDATA[" NavigateUrl="]]><xsl:value-of select="vchTxt6" />
<![CDATA[" ToolTip="]]><xsl:value-of select="vchTxt5" />
<![CDATA[" Target="]]><xsl:value-of select="vchTxt9" />
<![CDATA[" />]]>
<![CDATA[</p>]]>
</xsl:if>
<xsl:if test="string-length(vchAscxTagName) > 0">
<![CDATA[<wd:]]><xsl:value-of select="vchAscxTagName" /><![CDATA[ id=imageStrip" class="gallery_imageStrip" runat="server" ContentId=]]><xsl:value-of select="autContentId" /><![CDATA[" />]]>
</xsl:if>
<![CDATA[</div>]]>
</xsl:if>
<!--for 100 % container-->
<xsl:if test="intNum4 = 0">
<!--Website display-->
<![CDATA[<div style="clear: both;">]]>
<![CDATA[</div>]]>
<![CDATA[<div>]]>
<xsl:if test="string-length(vchImageUrl1) > 0">
<![CDATA[<div class="gallery_imgalign_one_column">]]>
<![CDATA[<asp:Image runat=server" class="gallery_img" ImageUrl=]]><xsl:value-of select="vchImageUrl1" />
<![CDATA[" ToolTip="]]><xsl:value-of select="vchImageAltText1" />
<![CDATA[" AlternateText="]]><xsl:value-of select="vchImageAltText1" />
<![CDATA[" />]]>
<![CDATA[</div>]]>
</xsl:if>
<![CDATA[<div class="gallery_one_column">]]>
<xsl:if test="string-length(vchTitle) > 0">
<![CDATA[<h1 class="gallery_title_one_column">]]>
<xsl:value-of select="vchTitle" />
<![CDATA[</h1>]]>
</xsl:if>
<![CDATA[<div class="gallery_description_one_column">]]><xsl:value-of select="vchTxt1" />
<![CDATA[</div>]]>
<xsl:if test="string-length(vchTxt4) > 0">
<![CDATA[<p class="gallery_plink_one_column">]]>
<![CDATA[<asp:HyperLink runat=server" class="gallery_link" Text=]]><xsl:value-of select="vchTxt4" />
<![CDATA[" NavigateUrl="]]><xsl:value-of select="vchTxt6" />
<![CDATA[" ToolTip="]]><xsl:value-of select="vchTxt5" />
<![CDATA[" Target="]]><xsl:value-of select="vchTxt9" />
<![CDATA[" />]]>
<![CDATA[</p>]]>
</xsl:if>
<xsl:if test="string-length(vchAscxTagName) > 0">
<![CDATA[<wd:]]><xsl:value-of select="vchAscxTagName" /><![CDATA[ id=imageStrip" class="gallery_imageStrip" runat="server" ContentId=]]><xsl:value-of select="autContentId" /><![CDATA[" />]]>
</xsl:if>
<![CDATA[</div>]]>
<![CDATA[</div>]]>
</xsl:if>
</ContentTemplate>
</WD:ContentController>
<xsl:if test="intNum4 = 0 or intNum4 = 1 or intNum4 = 2">
<![CDATA[</div>]]>
</xsl:if>
</xsl:when>

post-172099-0-48450000-1395848674_thumb.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...