Copied to clipboard

Flag this post as spam?

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


  • Jan 54 posts 74 karma points
    Apr 28, 2010 @ 13:27
    Jan
    0

    multiple variables to pull different mediapicker.

    hiim new to umbraco and macros are confusing me :(

     - im trying to make a button that the webuser can pick two pictures for - mouseover - mouseoff.

     

    how do i pull two different mediapickers into this macro - i can only write in the one variable there. and i dont know how to get a second (thought just making a

    <xsl:variable name="media" select="umbraco.library:GetMedia(number(data[@alias='excommknap']), 0)" />
    <xsl:variable name="media2" select="umbraco.library:GetMedia(number(data[@alias='excommhoverknap']), 0)" />

     

    would do it but i might be getting the wrong idea of this.

    can anyone tell me how i can pull out two mediapickers ?.

    (heres what i got)

    <xsl:for-each select="$currentPage/ancestor-or-self::node [@level=$level]/node [string(data [@alias='umbracoNaviHide']) != '1']">
     <!-- check if the 'media picker' property has a value -->
     <xsl:if test="data[@alias='excommknap'] != ''">
     
     <!-- get the media XML and assign it to a variable -->
     <xsl:variable name="media" select="umbraco.library:GetMedia(number(data[@alias='excommknap']), 0)" />
                                                           
     <!-- check if the media XML contains an image path 'umbracoFile' -->
      <xsl:if test="count($media/data[@alias='umbracoFile']) &gt; 0">
       <a href="{umbraco.library:NiceUrl(@id)}">

       <img class="ExcommKnap" src="{$media/data[@alias='umbracoFile']}" border="0"
       onmouseout="this.src='{$media/data[@alias='umbracoFile']}';this.alt='Der opstod en fejl med billede';"
       onmouseover="this.src=' <------this is where i want the second media picker to be placed ---------> ';this.alt='Der opstod en fejl med billede';"/>

       </a>
      </xsl:if>
     </xsl:if>
    </xsl:for-each>

    any help is appreciated.

  • Rasmus Berntsen 213 posts 251 karma points c-trib
    Apr 28, 2010 @ 14:02
    Rasmus Berntsen
    0

    Hmnn.. Adding an extra variable should be enough, I think. And then pulling the image like you're doing at the onmouseout:

    <xsl:variable name="media2" 
    select="umbraco.library:GetMedia(number(data[@alias='excommhoverknap']),
     0)" />
    onmouseover="this.src='{$media2/data[@alias='umbracoFile']}';this.alt='Der opstod en 
    fejl med billede';''

     

    I don't know if the javascript works, though. :)

Please Sign in or register to post replies

Write your reply to:

Draft