11-05-2009 11:43 AM
I want to embed some remote html pages into my widget I'm working on.
What is the easiest way to do this?
I tried a simple iframe to do it, just to get it working for a test, but this will not work on the device.
I also tried inserting it as an object, but this also doest not work.
Any examples of how to best implement this? Thanks in advance!
11-05-2009 11:47 AM
I just want to be clear on what you are looking for so I have a few questions for you:
- Are the pages your own pages, or from another site/vendor? (different possible solutions for different scenarios)
- Are you looking to embed their content into your page, or simply bring them up into the widget to be displayed?
11-05-2009 11:55 AM
I guess it would make it a little easier to answer wouldn't it!
I have a few widgets I would like to make. Both would be served by my own website, using my own pages. So I have access to both ends of the equation.
The first widget would embed a remote php page, that contains a form, and would then send the results of the form back to the php page. Where it would then act on the results.
The second widget would actually be a forum widget, interacting with my vbulletin based php forum.
Does that tell you enough about how I want to use it?
11-05-2009 12:24 PM
Sure.. that helps.
You have a couple of options for your first screen in your widget. You can make it either locally embedded into the widget or make it pull from an outside URL (aka your website). You can set this first page using the <content> element in your widget.
I've found that a local page loads much quicker in your widget than a remote page for obvious reasons, so it will depend on if you want faster load times v.s. easier to change dynamic first page.
You will need to make sure you whitelist the domain for your websites using the <access> elements. Be sure to check out the Developer guide on how to do this. Otherwise outside resources are not allowed into the widget. You must explicitly declare them.
Another interesting feature you may want to take advantage of, is that you can configure a "rim:header" attribute in the config.xml file so that your own personal header will be sent on any web request from your widget. That way you will know from your website, or vbulletin site, that it is being hit by your widget. This means that you can put in some custom server logic that would provide tighter integration with your widget than what you can do in the browser.
Hopefully this answers your question and I didn't go on too much of a rant
11-05-2009 12:39 PM
Oh and when I tried it before, using an <iframe> for a simple version, I would get the following where my iframe should be:
I had the access set correctly also.
11-05-2009 12:48 PM
Sorry I should have added that I want to run as much content local as possible for speed reasons.
My widget has all the images and content local, apart from the php remote form in question, which will be accessed from a certain page in my widget.
11-05-2009 12:54 PM
Yes, we are trying to track down the iframe issue...
To bring in your php remote form, you should just be able to put a hyperlink in your local content to the url of your remote form. It will then pull the remote form into your widget container and display it as long as it has been whitelisted
11-05-2009 02:02 PM
I don't know why I didn't think of just linking to it. lol
I guess I was over thinking the whole thing!
Do you have any examples of fetching pages as XML and then dealing with them?