Copied to clipboard

Flag this post as spam?

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


  • Owen Hope 119 posts 140 karma points
    Jul 08, 2011 @ 00:18
    Owen Hope
    0

    Hi!

    Love the Blog, better than the existing Umbraco Blog thats for sure!

     

    I am trying to embed videos into my blog, but haven't been able to do so...

    I tried using the oEmbed Macro and a couple others without success.


    Am I missing something? I'd like the ability to embed youtube and vimeo videos.

     

    Thanks,

     

    Owen

  • steweir 34 posts 54 karma points
    Jul 09, 2011 @ 19:35
    steweir
    0

    I had the same problem when trying to add a google map to a blog post

    I have found the problem but I’m not sure how to fix it

    As this forum post explains you have to set the text editor to run at server for the macros to show up otherwise they get commented out however because uBlogsy renders the text editor from a razor script I don’t know how to run the uBlogsyContentBody at server from within the razor script

    I tried adding this to the uBlogsyPost Template

       <umbraco:Item field="uBlogsyContentBody" runat="server"></umbraco:Item>

    And the the macos render fine however this is not a solution because you end up with only the body of the blog post and is only fix’s it for the blog post page no the home page..

    I hope someone can figure this out

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 10, 2011 @ 23:10
    Anthony Dang
    0

    Can you paste the rendered markup.

     

  • steweir 34 posts 54 karma points
    Jul 10, 2011 @ 23:25
    steweir
    0
      <h3><a href="/posts/2011/july/test-post-3.aspx"><span>Test Post 3</span></a></h3>
      <div class="uBlogsy_post_body">
       
      <span><umbraco:Item field="uBlogsyContentBody" runat="server"></umbraco:Item></span>
       
       
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      Vestibulum nec sagittis risus. Cum sociis natoque penatibus et
      magnis dis parturient montes, nascetur ridiculus mus.</p>
       
      <p>In sagittis nibh vitae justo aliquam feugiat. Proin risus sem,
      lobortis eu lacinia condimentum, consequat ut nulla. Aliquam tempus
      libero eu est tristique at interdum nisi dapibus.</p>
       
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      Vestibulum nec sagittis risus. Cum sociis natoque penatibus et
      magnis dis parturient montes, nascetur ridiculus mus. In sagittis
      nibh vitae justo aliquam feugiat. Proin risus sem, lobortis eu
      lacinia condimentum, consequat ut nulla. Aliquam tempus libero eu
      est tristique at interdum nisi dapibus.</p>
       
      <?UMBRACO_MACRO scurl="http://soundcloud.com/hendy666/summer"
      macroAlias="Soundcloud" />
       
      <p>&nbsp;</p>
       

    Theres some of the markup from a blog post

    let me know if you need anything else, im free for the next few hours and can test stuff on my server for you would be good to get this sorted :)

     

  • steweir 34 posts 54 karma points
    Jul 10, 2011 @ 23:29
    steweir
    0

    just realised i left this line of code on my site

    <span><umbraco:Item field="uBlogsyContentBodyrunat="server"></umbraco:Item></span>

     That was me messing around trying to get it to work, this line of code works if you put it in a template file but then you end up this the post displaying twice but if you put it in the cshtml file it just renders nothing hence why you can see it in my markup

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 10, 2011 @ 23:39
    Anthony Dang
    0

    Interesting...

    Have you tried pasting raw html in there rather than a macro? Or is that not an option?

     

     

  • steweir 34 posts 54 karma points
    Jul 11, 2011 @ 01:36
    steweir
    0

    If I add html to a post its fine, the problem is that the RTE is not been run at server therefore any macro in the RTE is just been ignored and not run correctly

    I think you need to change the way uBlogsyShowPost.cshtml works 

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 11, 2011 @ 12:57
    Anthony Dang
    0

    Damn I don't think my last post got saved.

    You're right about using umbraco:item.

    There is a problem with rendering a macro from inside a macro, and you need to use umbraco:item.

    One way you can get around this issue is to separate the uBlogsyShowPost script into 2 files. That way you can render umbraco:item in the master page between the 2 scripts which display everything else. 

     

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 11, 2011 @ 13:30
    Anthony Dang
    0

    I love how fast the umbraco community is at help.

    This should do the trick:

    Replace  the line @Html.Raw(d.GetProperty("uBlogsyContentBody").Value) in uBlogsyShowPost.cshtml with:
     

     

     

     

    @Html.Raw(umbraco.library.RenderMacroContent(d.GetProperty("uBlogsyContentBody").Value, d.Id)) 

     
     

    from this post:

    http://our.umbraco.org/forum/developers/razor/21275-Rendering-RTE-with-embedded-macros-in-Razor

     



Please Sign in or register to post replies

Write your reply to:

Draft