Working on project, I faced a necessity to create a embed-able code to other websites. Here is the preview of final result, I got:

Try it - click anywhere on above content.

The above posted content is posted by using widget, available here:

How to create a embed able widget

I used Web widget module and views. 

Once enabled web widget module, you can actually create embedable view - like views attachment. Your view should have path, in my case it's node/%/embed.

One of the realy nice features for this module - you can configure your display as iframe, inline javascript and more. 

Here is the screenshot of my views page:

If you are familiar with views attachments, then widget display wont be a problem for you. If not - create a new display - Widget, add fields, and attach display to page or block.

I had a problem with drupal_get_js and drupal_get_css - it displayed in embedded content sites css and js. To avoid that - I made a new template for my view, in which I @import my  .css style. To get rid of sites default css and js styles loaded on external site, I patched (uncomented, ok removed) drupal_get_css and drupal_get_js in modules template.

Works great with non Latin scripts as well:




If you need any assistance with creating embedable views - leave me a comment, or contact me