Copied to clipboard

Flag this post as spam?

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


  • Jon Behrens 53 posts 77 karma points
    Dec 06, 2012 @ 19:44
    Jon Behrens
    0

    Multiple website media problem

    I'm running two sites off of the same 4.9 installation (this is a rewrite from a 4.52 site which worked perfectly). I have a macro which serves a media image file depending on which site is showing. The content structure is as follows:

    - crimson
    - crimsonCom
    - crimsonOrg

    The macro is as follows:

       <xsl:template match="/">
    <xsl:variable name="logoID" select="$currentPage/logo"/>
    <xsl:choose>
    <xsl:when test="$logoID != ''">
    <img src="{umbraco.library:GetMedia($logoID, 0)/umbracoFile}"/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:variable name="home" select="$currentPage/ancestor-or-self::*[name() = 'homePage']/logo"/>
    <img src="{umbraco.library:GetMedia($home, 0)/umbracoFile}"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>

    What it does is checks whether the page has a logo (different for each site) if not, it looks for its ancestor home page and gets the logo for that page. The macro finds the correct media file in all cases, but the path inserted in the img tag has the root content node in front of it so the logo does not show. Like this:

    http://crimsonthread.com/Crimson/media/9/crimson.png

    The extra Crimson in the path is the problem. In the config file, I've tried umbracoHideTopLevelNodeFromPath both ways to no avail.

    As I mentioned above, this code worked fine in another site under 4.52

    Thanks for any help,

    Jon

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 06, 2012 @ 20:22
    Jan Skovgaard
    0

    Hi Jon

    That's a bit odd...

    You really only should get /media/9/crimson.png returned without the path...

    Is this a clean installation or have you upgraded from an earlier version? If so what steps did you take in order to do the upgrade?

    (Btw I would really recommend you upgrade to 4.11.1 if it's an option, since "Empty recycle bin" does not work in 4.9 - and there is a bug with uploading an image in Internet explorer where the path is messed up...oh yeah, and rollback gives a ysod and creates DB mess...so if it's possible. Do upgrade! :)).

    /Jan

  • Jon Behrens 53 posts 77 karma points
    Dec 06, 2012 @ 20:53
    Jon Behrens
    0

    Thanks Jan

    It's a new clean installation.

    I'm OK with going to 4.11 if I don't have to reload the entire site - I've got quite a bit of media that takes a day to upload - is it just a matter of uploading the bin, umbraco and umbraco_client directories?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 06, 2012 @ 21:11
    Jan Skovgaard
    0

    Hi Jon

    Well you should be able to upgrade without losing the uploaded media. But before you upgrade it's of course a must to make a backup of the files and the database of course. Otherwise you could end up crying...and boys don't do that, right? :-)

    I recommend that you first upgrade to 4.10.1 following these instructions http://umbraco.codeplex.com/releases/view/91737 and then go from 4.10.1 to 4.11 following these instructions http://umbraco.codeplex.com/releases/view/98167

    Hope this helps - if the strange stuff from above still happens after the upgrad let's have a closer look then :)

    /Jan

  • Jon Behrens 53 posts 77 karma points
    Dec 06, 2012 @ 21:55
    Jon Behrens
    0

    Hi Jan

    OK, I upgraded to 4.11.1 the backend shows up fine and all my content is there, but when I try and browse to the main site, I now get a 404 error.

    Jon

Please Sign in or register to post replies

Write your reply to:

Draft