Use FastShot From Other Modules

There are two ways to use FastShot from other modules:

  1. Use MyTokens integration covered in separate section
    This is especially useful when the image already exists in a FastShot module and needs to be injected into other modules that support MyTokens. This also offers automated features, changing the image in FastShot will reflect in all other modules that use it.
  2. Include FastShot instance on page
    This method is useful when the images are already included in the module and FastShot is needed to display them with LightBox script.
  3. Use Skin Object Patch documented below
    This method is useful when the images are already included in the module and for some reason including a FastShot module on the page is not possible (for example when you want to patch a large number of modules from different pages and don't want to include empty FastShot module on any page).

Implicit Patching

If you include a FastShot module on a page, all links from any other module on same page that have the lightbox CSS class will be automatically patched to open in LightBox. This method is far more easy that the method with the Skin Object in next section.


Example

Let's assume we want to patch images from an HTML module. We add an thumbnail image to the html module, then define a link that points to the full size image and set lightbox as the link class. The html source could look like this

<p>
<a href="/portals/0/dnn_large_banner.jpg" >
<img height="54" width="77" alt="" src="/Portals/0/conferences_icon.gif">
</a>
</p>

Then, all we have to do is include a FastShot module on the page. We can leave the FastShot module empty and hide the container and everything so the user won't notice it's there.

Note that when you define the link over the image the Rich Text Editor may insert calls to LinkClick.aspx instead of the actual path to image. The FastShot patching will work in this scenario too.



Skin Object Patch

This is a Skin object that can patch images on the page or from individual modules from the page to display with the LightBox script. It will patch all images that are links and have the lightbox class. The link must be to another image which will be open inside the LightBox.

To use the Skin Object Patch,

1. Open the DNN Skin used on the page that contains the modules you want to patch

2. At the top of the skin file, add the following include script

    <%@ Register TagPrefix="avt" TagName="FastShotPatchModule"
     Src="~/DesktopModules/avt.FastShot/SkinObject_PatchModule.ascx" %>

3. Include the Skin Object that does the patching; put the line below anywhere in the file

    <avt:FastShotPatchModule runat = "server" PatchModuleId = "123" />

The PatchModuleId identifies the module to patch images from. If you want all modules on the page to be patched, set this parameter to -1