Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bas Wensveen 54 posts 75 karma points
    Nov 27, 2010 @ 19:08
    Bas Wensveen
    0

    Hard to describe issiu, you have to see it for yourself

    Hi,

     

    Take a look a www.mckili.nl/locaties.aspx and investigate the generated html. The text under the image should be black but somehow  <a></a> is generated encapsulates the it. The code that generates the image slide show and the text under the image is listed below

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
        <!ENTITY nbsp "&#x00A0;">
    ]>
    <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="documentTypeAlias" select="string('Locatie')"/>
    
        <xsl:template match="/">
    
            <xsl:variable name="rootNode" select="$currentPage/ancestor-or-self::node[last()]" />
    
            <div id="referenties">
    
                <xsl:for-each select="$rootNode/descendant-or-self::node [@nodeTypeAlias = $documentTypeAlias]">
    
                    <div id="referntieItem">
                        <xsl:if test="./data [@alias='locatieFoto1'] != '' ">
                            <a  class="element_groep" rel="groep_ad">
                                <xsl:attribute name="href">
                                    <xsl:value-of select="./data [@alias='locatieFoto2'] "/>
                                </xsl:attribute>
    
                                <img>
                                    <xsl:attribute name="src">
                                        <xsl:text>/umbraco/ImageGen.ashx?image=</xsl:text>
                                        <xsl:value-of select="./data [@alias = 'locatieFoto1'] "/>
                                        <xsl:text>&amp;height=100&amp;compression=100</xsl:text>
                                        <xsl:text>&amp;fontsize=11&amp;fontcolor=white&amp;FontStyle=Bold&amp;align=center"</xsl:text>
                                    </xsl:attribute>
                                    <xsl:attribute name="alt">
                                        <xsl:value-of select="./node/@nodeName"/>
                                    </xsl:attribute>
                                </img>
                            </a>
                        </xsl:if>
                        <xsl:if test="./data [@alias='locatieFoto2'] != '' ">
                            <a class="element_groep" rel="groep_ad">
                                <xsl:attribute name="href">
                                    <xsl:value-of select="./data [@alias='locatieFoto2'] "/>
                                </xsl:attribute>
                            </a>
                        </xsl:if>
    
    
                        <br/>
                        <br/>
                        <xsl:value-of select="./data [@alias = 'bodyText'] " disable-output-escaping="yes"/>
                        <br/>
                        <hr/>
                        <br/>
                    </div>
    
                </xsl:for-each>
    
            </div>
        </xsl:template>
    </xsl:stylesheet>
    
    I really appreciatie if some can help me solve this mysterie

     

     

  • Kim Andersen 1447 posts 2197 karma points MVP
    Nov 27, 2010 @ 23:18
    Kim Andersen
    0

    Hi Bas

    Take a look at the following piece of code from your code above:

    <xsl:if test="./data [@alias='locatieFoto2'] != '' ">
       
    <a class="element_groep" rel="groep_ad">
             
    <xsl:attribute name="href">
                   
    <xsl:value-of select="./data [@alias='locatieFoto2'] "/>
             
    </xsl:attribute>
     
    </a>
    </xsl:if>

    This piece of code will mess up your code because the a-element doesn't contain any content. You have just created an empty a-element which means that your generated HTML will collapse. I can see that you have the same link around your image, but what do you want to do with the second a-element?

    Either you must put some content in this a-element or delete the whole section. Does that help?

    /Kim A

     

  • Bas Wensveen 54 posts 75 karma points
    Nov 28, 2010 @ 13:43
    Bas Wensveen
    0

    Hi Kim,

     

    This piece of code is generating the html for the jquery fancybox plugin. All pictures that need to be part of the slideshow are encapsulated with a link element. Do you have any suggestions to prevent the empty a-element?

     

    Regards,,

    Bas

     

  • Bas Wensveen 54 posts 75 karma points
    Nov 28, 2010 @ 13:57
    Bas Wensveen
    0

    Kim,

     

    I added a <xsl:text> elment with a &nbsp. That solved the problem. Thanks for pointing me in the right direction.

     

    Kind regards,

     

    Bas


  • Kim Andersen 1447 posts 2197 karma points MVP
    Nov 28, 2010 @ 16:55
    Kim Andersen
    0

    You are very welcome Bas!

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft