• Resolved mm88

    (@mm88)


    Hi, the syntax to put the GVIEW plugin into a page is: [gview file=”http://url.to/file.pdf”%5D

    but what is the (PHP/WP) syntax to put it in a .php page (attachment.php for ex.) in editing mode?

    a good alternative to GVIEW and editing flexible exists?

    thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Try the following:

    <?php echo do_shortcode('[gview file="http://url.to/file.pdf"]'); ?>

    Let me know if this does or doesn’t work, as I’ve not done this in a while.

    Thread Starter mm88

    (@mm88)

    thanks k3davis, it works!!! But now I have a problem passing the path variable.

    Writing

    <?php $filepdf = wp_get_attachment_url($post->ID);
    
    echo do_shortcode('[gview file="."$filepdf"."]'); ?>

    it dosen’t work.

    thanks again

    I’m not sure just what you’re doing there, so I’m not sure how much help I can be. What does not work when you do it this way, for starters? Does the viewer load but the document doesn’t display? Does nothing display at all (check the page source for “GDE” to see if any error is found there)?

    Thread Starter mm88

    (@mm88)

    It Does nothing display at all, because there’s an error in my php code syntax. The problem is displaying the $filepdf variable in the function echo.

    I don’t know the correct syntax.

    thanks

    I’m still not sure exactly what you’re trying to do, but you can try this:

    <?php $filepdf = wp_get_attachment_url($post->ID);
    
    echo do_shortcode('[gview file="'.$filepdf.'"]'); ?>

    It may just be a quotes problem, but then again I’ve never tried to pass a variable using the do_shortcode function, so I’m not sure if this is supported or not.

    Thread Starter mm88

    (@mm88)

    yes, it was a quotes problem: Now it works!

    many thanks k3davis!

    Glad it worked out. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Google Doc Embedder] embed it in the codex’ is closed to new replies.