// $Id: README.txt,v 1.1.2.8 2008/08/16 17:58:32 jtsnow Exp $ *------------------------ * Embed Widgets *------------------------ This module is a Google Summer of Code 2008 project. Project Wiki page: http://groups.drupal.org/node/10984 *------------------------ * Installation *------------------------ To install, place the entire embed_widgets folder into your modules directory. Enable the embed_widgets and embed_widgets_ui modules along with any "widget format" modules, by visiting Administer -> Site building -> Modules. The following widget format modules are available: -iFrame: Allows widgets to be embedded as iFrames. Allows widgets to be embedded on any webpage -Google Gadgets: Using Google's Gadget API, allows widgets to be embedded on any webpage, iGoogle, and in OpenSocial containers. For more information, see http://code.google.com/apis/gadgets/ -Facebook: Allows widgets to be embedded as FBML iFrames. Embed Widgets depends on the following modules that you will also need to download and install: Tabs: http://drupal.org/project/tabs Color Scheme API: http://drupal.org/project/color_scheme Embed Widgets also makes use of the Views module, but it is not required: Views: http://drupal.org/project/views *------------------------ * Setup *------------------------ You should also grant users the desired permissions after installing by going to Administer -> User management -> Permissions. Embed Widgets provides a suggested menu item titled "Embed Widgets". This menu item displays a list of widgets and also allows your users to create their own widgets. You may disable this menu item by going to Administer -> Site Building -> Menus. You may configure Embed Widgets by going to Administer -> Site Configuration -> Embed Widgets. *------------------------ * Usage *------------------------ To create a widget you must first create one or more widget sources, create a widget, and then copy the embed code. Widget Sources: A widget source is a piece of content from your site that you have allowed to be embedded in widgets. To create sources: 1. Go to Administer -> Site Building -> Embed Widgets. 2. Click "Sources" then click "Create Source". 3. Enter a title and a description for your source. 4. Select the type of source you would like to embed. a. Page: When adding a page, enter the relative path to the page that you would like to embed (i.e. node/25 instead of http://yoursite.com/node/25). b. Block: To add a block, select the block that you would like to embed from the drop down menu. Please note that blocks must be configured to show up in some Drupal region in order to be used. A block can alternatively be added as sources on via its block configuration page. At the bottom of the block configuration page, check the box that says "Provide this block as a source to be embedded in widgets." c. View: This option is available if the Views module is installed and enabled. In order to add any views as sources, make sure you have created one or more views. i. After selecting a view, you must select its display type. Whatever displays you created for the view will be available here. ii. If that display accepts any arguments, a field will be displayed for each arguments. Any arguments entered will be passed to the view for any user that adds this source to their widget. There are two wildcards that can be used for arguments: %uid and %user_name. If used, they will be replaced with the current user's user ID or user name, respectively. Sources Created by Modules: Sources may also be created by modules, much like how some modules create blocks. You do not have to create these sources, but to use them, they must be enabled. To enable these sources, go to Administer -> Site Building -> Embed Widgets -> Sources. In the list of sources, look for sources of type "module" and click the "Enable" link. These sources may also accept arguments. If you are a module developer, see API.txt for instructions on created sources with your module. Editing sources: The process is the same as adding a source. Be aware that any changes made to a source will be reflected in all widgets that are using it. Widgets: To create a widget: 1. Go to Administer -> Site Building -> Embed Widgets -> Create Widget OR Embed Widgets -> Create Widget. 2. Setup: Enter a title, description, and select one or more formats for your widget. Anyone with 'administer embed widgets' permissions can also add a widget to a list of recommended widgets. This list provides widgets for your users to use without them having to create their own. It is found in the Embed Widgets menu item. To add widget to this list, check the 'Recommend' box. 3. Content: Add content to your widget by checking the box next to the content you wish to add. Content may also be re-ordered by dragging the arrows next to each item. 4. Configure: This page is only for users with 'administer embed widgets' permission. It allows you to override tab titles and arguments. 5. Theme: You may select a theme from your widget, set widget width, height, color, background color, and font size. Not all themes support color and font properties. 6. Finished: To save your widget, click "Save and View Code". Editing widgets: Click the "Edit" link for the widget you would like to edit. The process is the same as adding a widget except that you do not have to use Back/Next buttons to navigate the forms. Be aware that deleting a widget will cause an "Error: not found" message to be displayed anywhere that widget has been embedded. It may be better to edit a widget instead of delete it. Embedding Widgets: 1. Go to Embed Widgets menu item. 2. Click the name of widget that you would like to embed. 3. Click the name of the format that you would like to embed 3. Copy the code from the textbox. 4. Paste the code into your site. Google Gadgets: To add a Google Gadget widget to your iGoogle hompage, click the "+Google" button. Google will cache your widgets, so changes made to widgets may not show up on Google Gadgets. Facebook FBML: Facebook does not allow iFrames to be embedded on profile pages, but they can be embedded in Facebook applications. To test this format, visit: http://developers.facebook.com/tools.php?fbml and paste FBML code in the test console. You may have to set Position to "Canvas".