Copied to clipboard

Flag this post as spam?

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


  • Robert Valcourt 70 posts 103 karma points
    May 05, 2017 @ 19:19
    Robert Valcourt
    0

    Does this package work on a site using webforms templates?

    Everything seems to work... images are getting uploaded to S3 but when using the RTE image tool the referenced image is coming from the /media folder instead of S3. Thoughts? All config values are set to true.

  • Tony Thompson 18 posts 90 karma points
    May 11, 2017 @ 15:32
    Tony Thompson
    0

    I have exactly the same problem as Robert. Image uploading works seamlessly but no matter how I try to position the media example code in my template I still get the local media folder referenced?

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    May 17, 2017 @ 13:24
    Ali Sheikh Taheri
    0

    Have you watched this video?

    https://youtu.be/LDYIKLFELc8

    You need to call MediaHelper.ParseMedia(" { url of image }")

    You can also find the source code here:

    https://github.com/AliSheikhTaheri/AST-Amazon-S3

    Hope this helps

    Ali

  • Tony Thompson 18 posts 90 karma points
    May 17, 2017 @ 14:10
    Tony Thompson
    0

    Hi Ali, thanks for responding.

    I have watched the video several times end-to-end to make sure im not missing something.

    I'm pretty sure I have correctly configured both the FileSystemProviders.config and the web.config files so that images are successfully uploaded to my S3 bucket.

    The 3 dlls are correctly located and I even cloned the source and rebuilt using the modifications suggested by Simon in this post: https://our.umbraco.org/projects/backoffice-extensions/ast-amazon-s3/ast-amazon-s3/81639-override-rte-media-picker-urls

    But it still references the 'local' media folder and not the S3 bucket.

    Clearly I'm doing something wrong but I can't identify what.

    here's the code from my template:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    

    @{ Layout = null;

    var image = AST.S3.Helper.MediaHelper.ParseMedia(Model.Content.GetPropertyValue<string>("Image"), Umbraco);
    
        if (image != null)
        {
        <img src="@image.Url" />
        }
        var home = @CurrentPage.Site();
        }
    
    
        <!DOCTYPE html>
        <html lang="en">
        <head>
    
            <!-- Meta tags -->
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <meta name="description" content="@CurrentPage.siteDescription">
    
            <title>@CurrentPage.Name | @CurrentPage._siteTitle</title>
    
            <!-- Fonts -->
            <link href="//fonts.googleapis.com/css?family=Nunito:400,700,300,900" rel="stylesheet" type="text/css">
            <link href="//fonts.googleapis.com/css?family=Droid Sans:300,400,700,900" rel="stylesheet" type="text/css">
    
            <!-- CSS -->
            <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
            <link rel="stylesheet" type="text/css" href="/css/fanoe.css">
            <link rel="stylesheet" type="text/css" href="/css/style.css">
            <link rel="manifest" href="/manifest.json">
    
            <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
            <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
            <!--[if lt IE 9]>
              <script src="//oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
              <script src="//oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
            <![endif]-->
        </head>
    
        <body>
            <header>
                <div class="container">
                    <div class="row">
                        <div class="col-xs-8 col-sm-12 col-md-4">
                            <a href="@home.Url">
                                <div class="brand" style="background-image:url('@(home.SiteLogo)?height=65&width=205')"></div>
                            </a>
                        </div>
                        <div class="col-sm-12 col-md-8">
                            <nav>
    
                                @{ Html.RenderPartial("MainNavigation"); }
    
                            </nav>
                        </div>
                    </div>
                </div>
    
                <div id="toggle" class="toggle">
                    <a href="#" class="cross"><span></span></a>
                </div>
            </header>
    
            @RenderBody()
    
            <footer class="field dark">
                <div class="container">
                    <div class="row">
    
                        @{ Html.RenderPartial("BottomNavigation"); }
    
                    </div>
                </div>
            </footer>
    
            <!-- Javascripts -->
            <script src="/js/jquery.min.js"></script>
            <script src="/js/bootstrap.min.js"></script>
            <script src="/scripts/fanoe.js"></script>
        </body>
    </html>
    
  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    May 17, 2017 @ 14:18
    Ali Sheikh Taheri
    0

    Do you have useCDN and cdnDomain in your web.config?

  • Tony Thompson 18 posts 90 karma points
    May 17, 2017 @ 14:33
    Tony Thompson
    0

    Yes, I think this is right?

    I do. yes

    and here's the other file (redacted a bit for obvious reasons)

    enter image description here

    and the version I am running is: Umbraco version 7.6.1 assembly: 1.0.6337.40631

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    May 17, 2017 @ 14:58
    Ali Sheikh Taheri
    0

    all setting seems to be right.

    What is the content of image variable in this line?

    var image = AST.S3.Helper.MediaHelper.ParseMedia(Model.Content.GetPropertyValue<string>("Image"), Umbraco);
    

    are you sure image is not null?

    If you don't mind can you also paste the html output for that section here so I can have a look

    Ali

  • Tony Thompson 18 posts 90 karma points
    May 17, 2017 @ 15:15
    Tony Thompson
    0

    I've just pushed the site up to my own domain so you can see it publicly.

    If you look at the standard 404 page here: http://tonythompson.co.uk/ali

    You can see the picture of the dog. This was only just added and it's appeared in my S3 bucket OK.

    If you view source you can see that it's being served from the media folder and not the CDN.

    Would it help for me to give you a login so you can see the back end? I can send via email or tweet it to you? This is only a test site so you can't hurt it

    Thanks again

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    May 17, 2017 @ 15:46
    Ali Sheikh Taheri
    0

    It seems that image is within the RTE and in order for images to work with RTE you need to use it as follow:

     @Html.Raw(AST.S3.Helper.ContentHelper.ParseContent(Model.Content.GetPropertyValue<string>("bodyText")))
    
  • Tony Thompson 18 posts 90 karma points
    May 17, 2017 @ 16:03
    Tony Thompson
    0

    OK, thanks Ali. I've moved it outside of the RTE now - just as a plain image but it's still referencing the local folder.

    I'm clearly not getting the syntax right somehow so I think I need to go back over my steps and try to better understand how it all hangs together.

    Appreciate your help.

Please Sign in or register to post replies

Write your reply to:

Draft