• Hey

    I want to insert my own Flash Video Player into a post/page by using [cft format = 0)

    The Cft Template looks like:
    [video]
    type = file
    relation = true

    The format #0 looks like: (‘use php’ is checked)

    <div id="video-container"><object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="500" height="300">
    		<param name="movie" value="<?php bloginfo('template_url') ?>/video/player.swf" />
    		<param name="allowfullscreen" value="true" />
    		<param name="allowscriptaccess" value="always" />
    		<param name="flashvars" value="file=<?php echo wp_get_attachment_url('[Video]'); ?>" />
            <object type="application/x-shockwave-flash" data="<?php bloginfo('template_url') ?>/video/player.swf" width="500" height="300">
    		<param name="movie" value="<?php bloginfo('template_url') ?>/video/player.swf" />
    		<param name="allowfullscreen" value="true" />
    		<param name="allowscriptaccess" value="always" />
    		<param name="flashvars" value="file=<?php echo wp_get_attachment_url('[Video]'); ?>" />
    
    		<p><a href="https://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p>
    		</object>
    	</object></div>

    Everything seems to work so far, except <?php echo wp_get_attachment_url(‘[Video]’); ?>

    echo ‘[Video]’; returns the right attachment id, and if i exchange this id with ‘[Video]’ like: wp_get_attachment_url(176) everything is fine.
    I’ve also tried to declare a new var with get_post_meta[…], tried to put [Video] in a new variable, tried to get the attachment id with other methods..but nothing worked, but i’m not a expert, and just might miss something.

Viewing 1 replies (of 1 total)
  • Thread Starter kai-ser

    (@kai-ser)

    ok, now i’ve finally found an other way to get the attachment url, but still no luck.
    now i have $mypath which stores the path to the file but
    <param name=”flashvars” value=”file=<?php echo $mypath; ?>” /> also does not work inside this shortcode…the other template tags do theit jobs..weird.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Custom Field Template] Shortcode Format: using [Key] with php’ is closed to new replies.