Copied to clipboard

Flag this post as spam?

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


  • wolulcmit 357 posts 693 karma points
    Nov 26, 2010 @ 13:22
    wolulcmit
    0

    how to call a video which is a child of $CurrentPage

    How do I render out my video if the page I'm a parent of the video I want to render:
    i.e I have a video doctype that takes a url parameter
    I through using recursive=true might work but no dice.

    <umbraco:Macro uTubeVideo="<umbraco:Item useIfEmpty='videoId' recursive='true' runat='server'></umbraco:Item>" uTubeWidth="185" uTubeHeight="130" Alias="uTube.ChromelessPlayer" runat="server"></umbraco:Macro>

    can you call a macro from another XSLT instead?

    I'm probably doing it all arse about face :)

    - Tim

     

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 26, 2010 @ 13:29
    Matt Brailsford
    0

    Hey,

    Would this not work?

    <umbraco:Macro uTubeVideo="[$videoId]" uTubeWidth="185" uTubeHeight="130" Alias="uTube.ChromelessPlayer" runat="server"></umbraco:Macro>

    This uses the advanced macro syntax to do a recurisve property lookup.

    http://our.umbraco.org/wiki/reference/templates/umbracomacro-element/macro-parameters/advanced-macro-parameter-syntax

    Matt

  • wolulcmit 357 posts 693 karma points
    Nov 26, 2010 @ 13:34
    wolulcmit
    0

    That works if I'm rendering from that page... i.e: http://localhost/home/screencast?alttemplate=home
    but not if I'm where I want to be at http://localhost/

    any ideas?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 26, 2010 @ 13:39
    Matt Brailsford
    0

    Ahhh, sorry, you want the video of a child element.

    I'd probably create a macro that does the look downwards, and use umbraco.library:RenderMacroContent to render out the macro:

    http://en.wikibooks.org/wiki/Umbraco/Reference/umbraco.library/RenderMacroContent

    Matt

  • wolulcmit 357 posts 693 karma points
    Nov 26, 2010 @ 14:03
    wolulcmit
    0

    Sweet, thanks Matt...

    I now have a very ugly:
    <
    xsl:value-of select="umbraco.library:RenderMacroContent('&lt;?UMBRACO_MACRO macroAlias=&quot;uTube.ChromelessPlayer&quot; uTubeVideo=&quot;videoId&quot; uTubeWidth=&quot;185&quot; uTubeHeight=&quot;130&quot; &gt;&lt;/?UMBRACO_MACRO&gt;', @id)" disable-output-escaping="yes" />

    how do I now get it recognise that videoId is a variable and not part of the string :)

    do I have to do a concat?

    I wish there was a

    <umbraco:Macro recursion="Downwards" uTubeVideo="[$videoId]" uTubeWidth="185" uTubeHeight="130" Alias="uTube.ChromelessPlayer" runat="server"></umbraco:Macro>

    or something :)

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 26, 2010 @ 14:06
    Matt Brailsford
    1

    Hehe, it would be easier =)

    You are meant to be able to pass it the ID of the node to render the control on behalf of (ie the child page) so you should be able to leave the value as [#videoId] but I beleive the "passing in the page id" thing doesn't really do anything, so yea, I think you best bet is to concat the string.

    Matt

  • wolulcmit 357 posts 693 karma points
    Nov 26, 2010 @ 14:18
    wolulcmit
    0

    Oh, it works. yipee!

    <xsl:variable name="ugliness" select="concat('&lt;?UMBRACO_MACRO macroAlias=&quot;uTube.ChromelessPlayer&quot;  uTubeVideo=&quot;', videoId, '&quot; uTubeWidth=&quot;185&quot; uTubeHeight=&quot;130&quot; &gt;&lt;/?UMBRACO_MACRO&gt;')" />
    <xsl:value-of select="umbraco.library:RenderMacroContent($ugliness, @id)" disable-output-escaping="yes" />

    nice to know for furture reference.


    Thanks Matt

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Nov 26, 2010 @ 14:22
    Matt Brailsford
    0

    No problem,

    Glad I was off use =)

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft