Copied to clipboard

Flag this post as spam?

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


  • Evan 344 posts 99 karma points
    Apr 16, 2009 @ 16:10
    Evan
    0

    Probably not extreme but need some XSLT help

    I have a site set up in the following fashion:
    Home (login)
    --company a
    -----sub 1
    -----sub 2
    -----sub 3
    --company b
    -----sub1



    Now on the company a and company b pages I have an uploaded to upload the company logo. I have placed the upload to go right above my sidebar navigation. Now I know I can just use the page field in the code and get the image to show up above the sidebar, but then it goes away when I am on the sub pages. What I need to do is pull in the image from the company a and company b pages in my xslt for my navigation. Here is my navigation as it stands now, this works, it shows company a and its sub children when in the company a section of the site, and vice versa for company b.



    ]>
    <>
    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"
    exclude-result-prefixes="msxml umbraco.library">












    Now I just need to use the root node (which points to either company a or company b) and grab the image that is uploaded.

  • dandrayne 1138 posts 2262 karma points
    Apr 16, 2009 @ 17:57
    dandrayne
    0

    Someone should be able to help you with a better solution, but you could check to see what level of nav you are on and move up to the correct parent

    (typed in to forum, probably has errors!)
    [code]





  • Evan 344 posts 99 karma points
    Apr 16, 2009 @ 18:30
    Evan
    0

    I am getting closer, if I use:


    as a test phrase I can get the root page body text on all of the sub pages and it works just as it should, however when i try and do this:


    I am getting an empty img src. I am using an upload field for the image with the alias companyLogo, what could I be doing wrong to not get the image?

  • Evan 344 posts 99 karma points
    Apr 16, 2009 @ 21:17
    Evan
    0

    anyone know why it wont show? I am pulling my hair out over here :)

  • Jesper Hauge 298 posts 486 karma points c-trib
    Apr 17, 2009 @ 01:07
    Jesper Hauge
    0

    Looks absolutely right to me, I would look for typos. Not sure why you're putting it in a xsl:for-each though.

    BTW I prefer this syntax for xsl-values in img-tag attributes:



    I believe your syntax results in a , when outputting xml.

    Regards
    Jesper Hauge

  • Evan 344 posts 99 karma points
    Apr 20, 2009 @ 19:45
    Evan
    0

    [quote=jhauge]Looks absolutely right to me, I would look for typos. Not sure why you're putting it in a xsl:for-each though.

    BTW I prefer this syntax for xsl-values in img-tag attributes:



    I believe your syntax results in a , when outputting xml.

    Regards
    Jesper Hauge[/quote]
    I decided to break away from using my navi and making my own xslt for the company logo and placing the macro above the sidebar navigation. Now I am still getting blank img src for some reason. Here is the code I am trying, I know the alias is correct as I copied and pasted from the doc type. What could be causing this? I am trying 2 different options to see which one works and neither are working right now, thats why there are 2 different img src that do the same thing with different syntax...
    [code]

    ]>

    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 ">










    [/code]

  • Evan 344 posts 99 karma points
    Apr 20, 2009 @ 20:07
    Evan
    0

    I figrued it out it was a spelling mistake...

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies