PageView Plugin – Embed an IFRAME in WordPress

download

Download: PageView
Version: 1.5.1
Supports: WordPress 2.5 – 3.1.1
Other: WordPress.org | SVN
Support: Forum

PageView is a plugin that will display another web page inside the current post. This is achieved with the use of an iframe – an HTML tag that allows a webpage to be displayed inline with the current page. Although an iframe can lead to a complicated website, it can be very effective when used appropriately.

Installation

  1. Download PageView
  2. Unzip
  3. Copy to your /wp-content/plugins directory
  4. Activate plugin

You can find full details of installing a plugin on the plugin installation page.

Usage

Insert iframes using WordPress shortcode syntax.

[pageview url="http://some.place"]

URL is a required parameter. The following are optional parameters:

  • title – A short title for the iframe
  • desc – A description for the iframe
  • width – The width of the iframe. Defaults to 100%, and can be specified in percent or pixel format (100px or 100%)
  • height – As above, but for height
  • border – ‘yes’ or ‘no’, defaults to ‘no’
  • scrolling – Whether to display scroll bars, ‘yes’, ‘no’, ‘auto. Defaults to ‘no’

For example:

[pageview url="http://apple.com" height="400px" border="yes']

Note: The plugin still supports the older pre-1.5 syntax:

[pageview http://some.place "title" description]

273 Responses to PageView Plugin – Embed an IFRAME in WordPress

  1. Excellent plugin!
    When I first read about it at WordPress Plugin DB, I thought to myself, how is this better than EZStatic? I didn’t know it wasn’t about putting static HTML inside template but inside posts – a truly unique solution. I love it.

    By the way, can you modify the plugin to accept also height and weight for the inline frame? The default are pretty small.

  2. Oh, also please add the example to the plugin description as shown in the admin panel so poeple don’t forget the format required.

  3. I’ve updated the plugin to include usage instructions in the plugin page. You can modify the dimensions of the frame by changing the CSS style. I’ve added a couple of details about this here on the page.

  4. Thanks Mathias. Yep, I spotted the object tag a few hours back and thought I was safe at least until tomorrow!

    The pre tag is fine for small bursts of code, but I created the plugin so as not to clutter up a post with a lot of code. I will investigate the Code Tag Transformation plugin further though – it certainly looks very pretty.

  5. Hi… Yes indeed, this is a very useful plugin… thanks a lot. Pardon my ignorance, but i just have to make this question if i want this plugin to work on my website:
    Where do i paste the css code?? at the end of the style.css file? or at the beggining? (if it helps, i’m using the pool theme)

    Thanks for any infor regarding that!!!

  6. Great Plug-in, this will make my site look more professional! I found a small bug, if you’re using John’s giraffe theme editor plug-in and one changes anything within it the pageview window is reduced in size and looks really bad. I found that if you input the required CSS code into the style.css in the giraffe plugin folder not in the theme’s folder the problem is fixed. It would be great if john includes this in his next version of giraffe’s plug-in.
    Thanks

  7. I’ve updated the Giraffe theme (1.17) so that you can now add CSS styles into ‘extra.css’ (in the giraffe theme directory). This means you can put the PageView styles, as well as any others you want, and they will be included as additional styles and will not be deleted by the Giraffe theme editor.

  8. I have been looking for a code like this. I have done everything instructed however nothing shows up when I add the code to a post. I am not sure I am writing it right?? I cut and paste, changed the url.. but nothing is showing up.

    I have added the codes to the CSS.. the plugin is activated.. what am I missing??

  9. Can you post it here (or in the ‘contact me‘ page) so I can have a look if you’ve typed anything wrong? Also, double-check that the plugin is activated in the WordPress admin section. If you move files about a plugin can get automatically disabled.

  10. i used the code and everything works fine, except for the fact that i can’t get the title to show. the description is ok however. perhaps you could show me what you used for your example above?

    eh?

  11. 1) Specify the width as a percentage to fit into your column
    2) Don’t give any value for the height. This will cause the iframe to be as tall as it needs to be.

  12. hmm. i have scott reilly’s “auto-link URLs” plugin and it keeps translating my pageview url, thus breaking it :( i’d like to keep the auto-linking though… could someone briefly explain the “object data” method of page inclusion?

  13. i mean, i read up on object data embedding, but if anyone could provide hints how use it to include a page in wordpress, that would be great. thanks :)

  14. Thanks job for putting this plugin together. It will be quite useful once I get it going. I am by no means a programmer, but I’d like to think I can be resourceful when I have to be, to figure something out. So I looked at your plugin code to maybe get a better idea or what I am doing wrong or a better idea of what this plugin expects from me when I use the for example, how does the plugin differentiate URL, from the title, from the description in order to separate them into the proper strings? Are there separators I am missing? I was thinking maybe the strings are separated by spaces, but then your description has multiple spaces. And then what if you wanted your title to be multi-word with one or more spaces? Are the strings comma separated? I must be missing something. Thanks again John. :-)

  15. Sorry I forgot to mention… I recently upgraded to wordpress 2.0. Do you know if that might be an issue with this plugin? How about with the UrbanGiraffe theme, which by the way is very slick and quite robust. Thank you for that too.

  16. Hi Walt,

    A URL cannot contain spaces so that is treated as 1 word. Currently the title cannot contain spaces, so that is also 1 word. The description is everything else after the title and so can contain spaces and many words.

    I don’t think there will be any issue with the plugin and 2.0 – the plugin is very simple and doesn’t use any advanced functions.

  17. When I use your CSS in this page, the display is not the same with your example in this page. Can you give my your example CSS? Many thanks.

  18. Dear John,

    At first when i installed your plugin, there was no problem at all, it all works like a magic to me :)

    And then i tried to implemented it in my wordpress’ page, and it works like a magic too :D

    And then, here comes the real trouble, after i press the “home” link, everything suddenly turns white. Just white, including the page with your plugin embedded too. The only page that works pretty well is only the admin page. I tried to deactivate, delete and reinstall your plugin, but it totally not works. I also clear every cache and cookies and it failed too.

    I really dunno what happened, ‘coz, before i click the “home” link, everything was fine.

    And one buddy of mine check it and said, it was all becoz of your plugin , he said your plugin broke the wordpress installation and i have to re-install the wordpress once again.

    I didnt mean to say that your plugin is buggy, i just curious, is it true, that sometimes in a very rare condition, this thing might happened? ‘coz i have seen one site that use your plugin works like a charm.

    For your information, i tried to embed pafiledb into my wordpress’ page. Is it happened only when someone tried to use your plugin with pafiledb?

    Best Regard

  19. No, it’s not possible for the plugin to break a WordPress installation. All it does is replace text when WordPress displays a page. No changes are made to files or the database

  20. I cannot figure out how to change the width on my i-frame

    I am using the Kubrick theme and add

    .stretch {
    width: 100%;
    }

    to the styles.css page through the theme editor.

    Then I use

    It opens the page at the default size. Please could someone spot what I am doing wrong.

    Thanks

  21. gregg: Look at the styles in pageview.css that’s in the plugin’s zip (added recently, so you may have an older version)

    golffee: Do you have the latest version from this page? Your icon is referring to /wp-content/pageview/pageview.gif, but the latest plugin is pointing at /wp-content/plugins/pageview/pageview.gif

  22. Hi, I’ve just dowloaded you plugin here today, but I can’t see any pageview.css in the plugin’s zip. As my icon’s referring to /wp-content/pageview/pageview.gif too, I think the version available for download may not be the latest. Am I wrong ?
    Thanks.

  23. Yes, the HTML code is stored in wp-content/plugins/pageview/view/default/pageview.php. You can either edit it there, or create a directory ‘view/pageview‘ in your theme, copy the above file there, and modify it on a theme-by-theme basis (you’ll need version 1.3 for that)

  24. Hello John,
    great plugin. thanks for that.
    the only thing i can’t get working is how and where to define the width and higth of the iframes.

  25. Sorry for not answering sooner. Still having problems with this. ANY url I use comes back to [[[1]]] and with the 1.4 version of your plugin, the tag doesn’t even get converted to an iframe, it just stays as a comment tag.

    becomes

    Any ideas? (I put the extra spaces next to the to stop them being converted here)

  26. Graeme, are you using the WordPress visual editor? If you are, it’s likely that it may be mangling the code. I’ve updated the plugin to use a different tag which won’t be affected by visual editors.

  27. Not using the visual editor, but your solution of changing the tag worked.

    However, I have another issue. Now that it’s doing the right interpretation of the tag, the URL is cocked up a little.. The output is coming up as:

    (I’ve added the "-" after the "

    Title:
    http://bytor.co.uk/photo-gallery/showcase" >Testing

    Description:
    Test Description

    http://bytor.co.uk/photo-gallery/showcase" frameborder="0" >Get a better browser!

  28. Hi

    Love your work….

    I’m sure if there is a good reason, but why don’t you use the Exec-PHP plugin and enter the following into the post/page

    require ‘page.php’;
    ?>

    It works for me :)

    Steve

  29. For me it acts really weird…I am using TinyMCE so maybe it has something to do with it…
    but when I use

    [pageview http://west1.vallema.com "Standings" This is where our team RUNNERS currently stands in the Dutch Leage (probably 5th level down from the top)]

    the result is that the word com becomes the title and the rest won’t work anymore since it can’t find west1.vallema -address (missing the .com)

    any help would be appreciated…

    cheers,
    Kimmo

  30. Kimmo, are you sure you are using the latest version? I tried the exact same tag and it worked fine (actually I noticed some spurious quote marks, which have now been removed).

    Same for you too Graeme, I have your tag in my test site and the plugin displays the page. I’ve tried this with both TinyMCE and without and the same thing.

  31. Hi

    I used the plugin from . This allowed me to use php script within the posts or pages….. as it says on their website ‘ The Exec-PHP plugin executes <?php ?> code in your posts, pages and text widgets.

    Then I simply used the php REQUIRE or INCLUDE command … example:-


    <?php
    require 'http://www.yourwebpage.com/page.php';
    ?>

    Cheers

    Steve

  32. Steve, that’s a very different method and puts a lot of load on your website – everytime the page is displayed your webserver has to go and downloaded the external page. This is very inefficient and on a busy page could soon kill your site.

    Also, I have a competing plugin called Sniplets, which works around this problem.

  33. Dammit! I’ve found the problem…

    I have been using the latest plugin all the way through this, but it turns out another plugin has been rewriting your URL, along with a couple of other things (just updated that plugin recently :()

    The offender is http://zechs.dyndns.org/wordpress/?page_id=126 "MediaWiki Markup for WordPress" v0.0.6-r3. I never saw this behaviour with v0.0.6-r2 so I may go back to that.

    Sorry for giving you the runaround. Should be beating up that other author ;)

  34. I tried to use this plugin with WordPress 2.3.1 and it doesn’t work at all !
    Here is my code I insert in the page post (code textfield) :
    [pageview http://dreamgratuit.canalblog.com "Dreamgratuit" Extensions et tutoriaux pour Dreamweaver]

    Did I do something wrong ?

  35. I tried to disable some other plugin and now it’s OK but sometimes I have trouble with my Apache Server (WordPress is at this time running on my dev server, "localhost" with EasyPHP. Maybe the reason why ?).

    I also tried to hide the pageviewhead using the CSS property visibility:hidden instead of the 5 lines in the original code but there is still the table in the code and a white space on the page. Is there a way to delete this white space ?

  36. You need to modify pageview.css in the plugin directory and add a specific height:

    div.pageview
    {
    height: 200px;
    }

    Alternatively you can add this to style.css in your theme.

  37. Hi John,
    As you stated, the code below changes the length of the iframe. is there a way for the iframe to dynamically adjust to the length of iframed webpage as the pages of the iframed webpage change length? I’m trying to achieve the seamless look.

    div.pageview
    {
    height: 200px;
    }

    Thanks!
    Steve

  38. I’ve left two comments now and both mysteriously disappeared. Go to jeremysarber.com/personal and click the "Current Chess Game" link at the top. You’ll see what it does.

  39. Hey again. It turns out that the page I was trying to present in the frame was causing the problem. I don’t fully understand why but certain pages of GameKnot.com could not be displayed. It automatically redirected users from my page (with Pageview being used on it) to GameKnot. Thanks anyway.

  40. This works great. However i’d like to keep the actual url to the page in the iframe hidden. If a user clicks on the title, the url is then displayed. Is their a way to keep that from being displayed?

  41. Hi John,
    I am new to all of this and have been learning by trial and (mostly) error, so I would appreciate any help you can give me. I am using WordPress 2.5, the Autumn Concept 1.1 theme. I am trying to insert an Amazon.com astore into a webpage I have titled “Store” I have successfully downloaded your plug-in and activated it.
    In the HTML editor for this page, I’ve typed: what I believe your instructions said, and immediately followed it with the astore code, as follows:

    [pageview http://retireforlessincostarica.com/store/ "Retire for Less in Costa Rica" Store]

    However, when I publish and preview the page, all I see is a 404 Error. What am I doing wrong? Do I need to use the tags? Do I need to copy something from the pageview style sheet into my html editor?

    Thanks in advance,
    MightyA

  42. I have modified this a bit. I was unhappy with the way it handled the template file and how restrictive it was on the formatting. So I rewrote the replace routine in the class to find all key value pairs and pass them on to the template processing function. So now instead of being stuck with just url, description, and title you can use whatever you want (and as many as you want) Here is the change in usage.

    All parameters are optional. However it would be useful to have at least something that passes the url.
    [pageview parameter='value'...]

    To work with the existing template just pass these parameters
    ex.
    [pageview url='url' description='this is the description' title='this is the title']

    I like to throw on a style parameter so I can control the height of the iframe. That means that I must use that variable in the template file.

    <iframe src="" frameborder="0" style="" >Get a better browser!

    here is the change in the function in pageview.php

    function replace ($matches)
    {
    //Separate all the parameters
    preg_match_all("/\w*='[^']*'/", $matches[0],$allParameters);

    //split each parameter into a key=>value pair
    foreach ($allParameters[0] as $parameter) {
    $pair=split("='", $parameter); //do the split
    $pair[1] = trim($pair[1],"'"); //Trim off the trailing single quote

    //store the key value pair
    $pairs[$pair[0]] = $pair[1];
    }

    return $this->capture('pageview', $pairs);
    }

Pings

rishel.org | my.donews.com | my.donews.com | wp-plugins-db.org | 5mzen.com | rocketmonkeyrodeo.com | lessnau.com | journal.norlich-segen.net | ebooks-with-reseller-rights.com | elraul.com | wordpress-magazine.com | blog.bikershrek.de | hyperpac.info

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>