Jump to content
bfarber
 Share


IP.Content 2.1 Dev Update: External Widgets

IP.Content is a powerful toolset that allows you to create dynamic pages and content on your site, utilizing all of the APIs IP.Board provides. Using these tools, you can create pages, templates and blocks that retrieve, transform, and output data in your IP.Board and addon application databases. IP.Content can even allow you to take blocks you have created and integrate them into any page in IP.Board itself, so you can create dynamic content-driven blocks on any page of your IP.Board installation with ease.

While the integration possibilities are quite robust within IP.Board, we wanted to take this a step further and allow you to implement blocks created in IP.Content anywhere! Imagine if you could create a feed of the latest topics on your forum, and integrate that into your Wordpress blog? Or imagine creating a feed of your latest Gallery images to show on your website homepage, simply by inserting a little tag into your homepage HTML file? With IP.Content 2.1, you will be able to do exactly that.


A new "external.php" file will be included in the Tools folder of your IP.Content download. You will first need to upload this to your IP.Board root directory.

Then, in the ACP Block Management page, you will see a new icon next to every IP.Content block.



When you click this icon, you will be presented with a small modal box that includes the exact HTML (a javascript tag) that you need to include where-ever you want the block to show up



You simply copy this javascript tag, and paste it into your page where-ever you would like for the block to show. It really is that simple! Additionally, while this is not the "preferred" method of integrating blocks into your IP.Content pages themselves, there is nothing stopping you from doing so if you find this method to be the easiest way to include your blocks in your pages.

I have created a short video to demonstrate how this works. Hopefully you will be able to see just how easy this new feature is to use in IP.Content through a short tutorial example.



As you can see, there is really nothing to it - you simply copy a tag into your HTML page and the block shows up. Additionally, because the block is loading off of your forum domain and utilizing the IP.Board framework, all member data is available to the block. You can create user profile blocks, for instance, and show them on your external site, providing an easy way to integrate "member" functionality into your site without having to create your own membership system, or tie your site into your IP.Board installation through backend PHP code.


Some Boring Techy Details, if you are interested

The block is implemented via a javascript tag, which then renders an iframe into the page. The iframe will size dynamically so that all of the block content is displayed, and scrollbars are not. You can override this on a per-block basis, simply by changing the URL in the script tag to include "&w=xx&h=xx" parameters (you can provide either parameter, or both parameters) if you wish to set a static width and/or height (if you do so, the iframe will automatically show scrollbars as one would expect).


We hope you like this new feature in IP.Content 2.1, and that it will help you expand your website in easy and fun ways. Let us know what you think in the comments!
 Share

Comments

Recommended Comments



If I understand correctly, I can create widget of new topics and when I paste that code to the some external page on other domain, those topics will be there generated? That's cool, I was looking for that very long time :)

Link to comment
Share on other sites

  • Management

Put simply: anything that can be made into an IP.Content Block can be served as an external widget and external widgets can be embedded in any web page anywhere that you can put in the JavaScript tag it generates :)

This is a big deal in that it allows your community content to "break out" of the box of our software and be syndicated/embedded anywhere you like.

Link to comment
Share on other sites

Oh dear... This is GREAT!

In terms of security:
Is it possible to limit widgets per domain. As I wouldn't want all my blocks to be accessable externally via some URL manipulation or due to some leak.

Link to comment
Share on other sites

  • Management

[quote name='Ohn03s' date='26 October 2010 - 10:48 AM']
Oh dear... This is GREAT!

In terms of security:
Is it possible to limit widgets per domain. As I wouldn't want all my blocks to be accessable externally via some URL manipulation or due to some leak.


We thought about this but could not yet come up with a 100% way to do this. We could add JavaScript to detect domain and report it but it would be trivial for someone to just put in extra JavaScript code to fake the domain-reporting. We are continuing to research methods to bind it to a domain and if we come up with a reliable way we will certainly update IP.Content with that feature.

Link to comment
Share on other sites

[quote name='Ohn03s' date='26 October 2010 - 10:48 AM']
Oh dear... This is GREAT!

In terms of security:
Is it possible to limit widgets per domain. As I wouldn't want all my blocks to be accessable externally via some URL manipulation or due to some leak.


We have thought about this a little, and put simply - it's not very easy to do. Once you put any code into an HTML page, a "hacker" need only copy that code and embed into his page. You can't easily verify the domain of the request in a reliable manner (you would have to use the "referrer" HTTP header, which users can disable and modify at will), and javascript implementations obviously can be tinkered with. We will evaluate the need and possibilities moving forward for securing blocks to only work on specified domains, but wanted to get the functionality out there for you to begin using now.

Link to comment
Share on other sites

[quote name='Charles' date='26 October 2010 - 10:46 AM']
Put simply: anything that can be made into an IP.Content Block can be served as an external widget and external widgets can be embedded in any web page anywhere that you can put in the JavaScript tag it generates :)

So like adding a widget on a personalized Google page or in an instant messenger service, for instance?

Link to comment
Share on other sites

  • Management

[quote name='Wolfie' date='26 October 2010 - 10:53 AM']
So like adding a widget on a personalized Google page or in an instant messenger service, for instance?


If you can embed JavaScript then it should work yes.

Link to comment
Share on other sites

  • Management

[quote name='seax' date='26 October 2010 - 10:56 AM']
Would this work on something like Facebook? i.e when you set up a page for your company etc in Facebook, could we have IP.Board boxes on that page?


Does Facebook allow for external JavaScript to be inserted? I kind of doubt it but I'm sure you could try it :)

Link to comment
Share on other sites

This could actually be a big plus.

It would allow people to use IP.Content to create blocks, but nothing more. They could then use their Wordpress blogs 'integrated' with IPB.

If done right, would I be right in thinking that you could use a raw PHP block as this as well (including the external.php file rather than scripting it in), and then create a integration module between systems..... This could be interested.

Link to comment
Share on other sites

Is there a way to create membership block that will allow members to connect using forum account?
I know there's IP.Converge but I'm looking for something more easy to connect with.
Something like Facebook Connect or Twitter oAuth.

Is it possible?

Link to comment
Share on other sites

[quote name='Ran Yefet' date='26 October 2010 - 11:27 AM']
Is there a way to create membership block that will allow members to connect using forum account?
I know there's IP.Converge but I'm looking for something more easy to connect with.
Something like Facebook Connect or Twitter oAuth.

Is it possible?


Yes and no. This integration is not going to suddenly provide you with a fully-featured membership system, however you can use the blocks to integrate member-specific data (such as a mini-profile block, or a "your watched topics" block, etc.) for users.

A membership system encompasses so much more than a few blocks on the page, however you can build something that will, on the surface, represent your member data external to your forums.

[quote name='mAxL' date='26 October 2010 - 01:07 PM']
Whats differemce using this tool than parse module? :ninja:


If I make a .html page and add {parse module=''} to it, that won't do anything. You can only use parse tags within IPB. This new feature is meant to allow you to show blocks OUTSIDE IPB (as in, anywhere on the internet that you can insert a javascript tag to).

Link to comment
Share on other sites

If i understand correctly,

I do not use IP.Content currently for pages. But if i wanted to add a "login" box to my joomla site, this would fit the bill? Without using IP.Content for anything else?

Link to comment
Share on other sites

[quote name='Stephen D' date='26 October 2010 - 04:07 PM']
could you make it smart enough auto add to clipboard? save a few extra steps :)


I see no point...I'm opposed to anything modifying my clipboard without my explicit consent, and most browsers these days agree, blocking access to clipboard unless you enable certain settings to explicitly allow it.

Link to comment
Share on other sites

[quote name='Heyhoe' date='26 October 2010 - 03:18 PM']
If i understand correctly,

I do not use IP.Content currently for pages. But if i wanted to add a "login" box to my joomla site, this would fit the bill? Without using IP.Content for anything else?


Correct. :) If you used the out of the box welcome block, it would show a login box for guests, or if you are logged in it will show some of your forum statistics with important links. As I mentioned above, this is an easy way to transparently add "membership" functionality, if you don't have heavy requirements for integration on the backend.

Link to comment
Share on other sites

[quote name='bfarber' date='26 October 2010 - 04:52 PM']
We have thought about this a little, and put simply - it's not very easy to do. Once you put any code into an HTML page, a "hacker" need only copy that code and embed into his page. You can't easily verify the domain of the request in a reliable manner (you would have to use the "referrer" HTTP header, which users can disable and modify at will), and javascript implementations obviously can be tinkered with. We will evaluate the need and possibilities moving forward for securing blocks to only work on specified domains, but wanted to get the functionality out there for you to begin using now.

I assume the external.php is where things are being called for. can't you do something like


(I havent seen or understand how it works yet, but just assuming thing .. so my codes here ^ could be totally wrong )


Anyways way to go guys IPC is and have always been my fav add-on


if(!stristr($this->settings['base_url'] , 'domain.com'))

{

exit();

}

Link to comment
Share on other sites




Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...