Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 13 of 13

Thread: Get Image From Another Location/URL

  1. #1
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default Get Image From Another Location/URL

    Hello,

    I am using the product.SimpleVariantFormat.xml.config package, and I see this line:

    Code:
    <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
    I am assuming this displays the medium image. I would like to change this to point to a different URL, but I would like to pass the SKU as a parameter as well.

    For example: http://s7sps1.scene7.com/s7/uviewer....s1.scene7.com/

    I am using Adobe Scene7. They say that I can just copy and paste a link and pass a parameter to view an image. And that makes sense. However, I am not sure how I would pass the SKU to the URL in the XML package, say where 9050037 is.

    Could someone help me with this please?
    Last edited by donato; 10-04-2012 at 01:43 PM.

  2. #2
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Please... I really need some help with this.

  3. #3
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Do you mean something like this?

    Code:
    <img src="http://www.domain.com/{SKU}.jpg" alt="alt text"/>


    TTFN

    BFG

  4. #4
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Quote Originally Posted by BFG 9000 View Post
    Do you mean something like this?

    Code:
    <img src="http://www.domain.com/{SKU}.jpg" alt="alt text"/>


    TTFN

    BFG
    Yes. Exactly! But I want to get the SKU of the product that is being viewed... Is it THAT easy?! How would I do that in the XML package?

  5. #5
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    I tried that in the XML package and it doesn't work... I thought putting this in the URL would work, but it doesn't:

    <xsl:value-of select="SKU" /> or even <xsl:value-of select=SKU/>
    Last edited by donato; 10-05-2012 at 05:47 AM.

  6. #6
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    I tried this too:

    <img>
    <xsl:attribute name="src">
    URL with <xsl:value-of select="SKU" />
    </xsl:attribute>
    </img>

    Nothing.

  7. #7
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    And I tried this:

    <img src="concat('http://s7sps1.scene7.com/s7/uviewer.jsp?asset=CompanyName/',SKU,'&amp;config=Scene7SharedAssets/Universal_ImageSet1-2&amp;isr=http://s7ips1.scene7.com/')"/>

    Nothing still... It doesn't error out, I just have a blank area. No image.

  8. #8
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    I think that the problem is that this code doesn't work either :-

    Code:
    <img src="http://s7sps1.scene7.com/s7/uviewer.jsp?asset=CompanyName/9050037&config=Scene7SharedAssets/Universal_ImageSet1-2&isr=http://s7ips1.scene7.com/" />
    i.e. - that url does not return an image.


    TTFN

    BFG

  9. #9
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Quote Originally Posted by BFG 9000 View Post
    I think that the problem is that this code doesn't work either :-

    Code:
    <img src="http://s7sps1.scene7.com/s7/uviewer.jsp?asset=CompanyName/9050037&config=Scene7SharedAssets/Universal_ImageSet1-2&isr=http://s7ips1.scene7.com/" />
    i.e. - that url does not return an image.


    TTFN

    BFG
    It actually does... I just changed our company name to "CompanyName". I can PM you the actual URL if you want?

  10. #10
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    I am not able to send you a PM...

  11. #11
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    johno [at] xmldr [dot] com

  12. #12
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Quote Originally Posted by BFG 9000 View Post
    johno [at] xmldr [dot] com
    Thank you very much! I just sent you an email...

  13. #13
    GoVedia is offline Member
    Join Date
    Oct 2012
    Location
    Orange, CA
    Posts
    98

    Default Concat

    This should do the trick:

    Code:
     
    <img>
    <xsl:attribute name="src">
    <xsl:value-of select="concat('http://s7sps1.scene7.com/s7/uviewer.jsp?asset=CompanyName/',SKU,'&amp;config=Scene7SharedAssets/Universal_ImageSet1-2&amp;isr=http://s7ips1.scene7.com/')"/>
    </xsl:attribute>
    </img>
    You can verify by viewing your HTML source through your web browser.

    Robert